[i-g-t,v2-resend-reviewed,1/2] lib/psr: Add a macro with the maximum lenght of i915_edp_psr_status and use it

Submitted by José Roberto de Souza on Jan. 11, 2019, 10:51 p.m.

Details

Message ID 20190111225148.28380-1-jose.souza@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in IGT

Not browsing as part of any series.

Commit Message

José Roberto de Souza Jan. 11, 2019, 10:51 p.m.
So every function reading i915_edp_psr_status can allocate a buffer
long enough.

Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 lib/igt_psr.c                    | 2 +-
 lib/igt_psr.h                    | 2 ++
 tests/kms_fbcon_fbt.c            | 6 +++---
 tests/kms_frontbuffer_tracking.c | 2 +-
 tests/kms_psr.c                  | 2 +-
 5 files changed, 8 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index 0ddfb64f..c105bb6e 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -28,7 +28,7 @@ 
 static bool psr_active(int debugfs_fd, bool check_active)
 {
 	bool active;
-	char buf[512];
+	char buf[PSR_STATUS_MAX_LEN];
 
 	igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf,
 				sizeof(buf));
diff --git a/lib/igt_psr.h b/lib/igt_psr.h
index b9693822..96f7bedf 100644
--- a/lib/igt_psr.h
+++ b/lib/igt_psr.h
@@ -28,6 +28,8 @@ 
 #include "igt_core.h"
 #include "igt_aux.h"
 
+#define PSR_STATUS_MAX_LEN 512
+
 bool psr_wait_entry(int debugfs_fd);
 bool psr_wait_exit(int debugfs_fd);
 bool psr_enable(int debugfs_fd);
diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c
index 24d3ad90..0ad53266 100644
--- a/tests/kms_fbcon_fbt.c
+++ b/tests/kms_fbcon_fbt.c
@@ -170,7 +170,7 @@  static void set_mode_for_one_screen(struct drm_info *drm, struct igt_fb *fb,
 
 static bool psr_supported_on_chipset(int debugfs_fd)
 {
-	char buf[256];
+	char buf[PSR_STATUS_MAX_LEN];
 	int ret;
 
 	ret = igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status",
@@ -188,7 +188,7 @@  static bool connector_can_psr(drmModeConnectorPtr connector)
 
 static void psr_print_status(int debugfs_fd)
 {
-	static char buf[256];
+	static char buf[PSR_STATUS_MAX_LEN];
 
 	igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf,
 				sizeof(buf));
@@ -197,7 +197,7 @@  static void psr_print_status(int debugfs_fd)
 
 static bool psr_is_enabled(int debugfs_fd)
 {
-	char buf[256];
+	char buf[PSR_STATUS_MAX_LEN];
 
 	igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf,
 				sizeof(buf));
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 5ab28319..c366fecf 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -1419,7 +1419,7 @@  static void teardown_fbc(void)
 
 static bool psr_sink_has_support(void)
 {
-	char buf[256];
+	char buf[PSR_STATUS_MAX_LEN];
 
 	debugfs_read("i915_edp_psr_status", buf);
 	if (*buf == '\0') /* !HAS_PSR -> -ENODEV*/
diff --git a/tests/kms_psr.c b/tests/kms_psr.c
index d00e552f..20b69892 100644
--- a/tests/kms_psr.c
+++ b/tests/kms_psr.c
@@ -191,7 +191,7 @@  static void fill_render(data_t *data, uint32_t handle, unsigned char color)
 
 static bool sink_support(data_t *data)
 {
-	char buf[512];
+	char buf[PSR_STATUS_MAX_LEN];
 
 	igt_debugfs_simple_read(data->debugfs_fd, "i915_edp_psr_status",
 			 buf, sizeof(buf));

Comments

Pushed, thanks for the reviews DK.

On Sat, 2019-01-12 at 07:54 +0000, Patchwork wrote:
> == Series Details ==
> 
> Series: series starting with [i-g-t,v2-resend-reviewed,1/2] lib/psr:
> Add a macro with the maximum lenght of i915_edp_psr_status and use it
> URL   : https://patchwork.freedesktop.org/series/55105/
> State : success
> 
> == Summary ==
> 
> CI Bug Log - changes from CI_DRM_5408_full -> IGTPW_2227_full
> ====================================================
> 
> Summary
> -------
> 
>   **SUCCESS**
> 
>   No regressions found.
> 
>   External URL: 
> https://patchwork.freedesktop.org/api/1.0/series/55105/revisions/1/mbox/
> 
> Known issues
> ------------
> 
>   Here are the changes found in IGTPW_2227_full that come from known
> issues:
> 
> ### IGT changes ###
> 
> #### Issues hit ####
> 
>   * igt@i915_suspend@sysfs-reader:
>     - shard-snb:          PASS -> INCOMPLETE [fdo#105411]
> 
>   * igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
>     - shard-apl:          NOTRUN -> DMESG-WARN [fdo#107956]
> 
>   * igt@kms_cursor_crc@cursor-64x21-sliding:
>     - shard-apl:          PASS -> FAIL [fdo#103232] +3
>     - shard-kbl:          PASS -> FAIL [fdo#103232]
> 
>   * igt@kms_cursor_crc@cursor-64x64-sliding:
>     - shard-glk:          PASS -> FAIL [fdo#103232] +5
> 
>   * igt@kms_cursor_crc@cursor-64x64-suspend:
>     - shard-apl:          PASS -> FAIL [fdo#103191] / [fdo#103232]
> 
>   * igt@kms
> _cursor_legacy@2x-long-nonblocking-modeset-vs-cursor-atomic:
>     - shard-glk:          PASS -> FAIL [fdo#105454]
> 
>   * igt@kms_flip@modeset-vs-vblank-race:
>     - shard-hsw:          PASS -> DMESG-FAIL [fdo#102614] /
> [fdo#103060]
> 
>   * igt@kms
> _frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-wc:
>     - shard-kbl:          PASS -> FAIL [fdo#103167]
> 
>   * igt@kms
> _frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-render:
>     - shard-apl:          PASS -> FAIL [fdo#103167] +4
> 
>   * igt@kms_frontbuffer_tracking@fbc-1p-rte:
>     - shard-apl:          PASS -> FAIL [fdo#103167] / [fdo#105682]
> 
>   * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
>     - shard-glk:          PASS -> FAIL [fdo#103167] +5
> 
>   * igt@kms_plane@pixel-format-pipe-a-planes:
>     - shard-kbl:          PASS -> FAIL [fdo#103166] +3
> 
>   * igt@kms_plane_alpha_blend@pipe-c-alpha-opaque-fb:
>     - shard-apl:          NOTRUN -> FAIL [fdo#108145]
> 
>   * igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
>     - shard-apl:          PASS -> FAIL [fdo#103166] +3
> 
>   * igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
>     - shard-glk:          PASS -> FAIL [fdo#103166] +8
> 
>   * igt@kms_setmode@basic:
>     - shard-apl:          PASS -> FAIL [fdo#99912]
> 
>   
> #### Possible fixes ####
> 
>   * igt@kms_available_modes_crc@available_mode_test_crc:
>     - shard-apl:          FAIL [fdo#106641] -> PASS
> 
>   * igt@kms_cursor_crc@cursor-128x128-random:
>     - shard-apl:          FAIL [fdo#103232] -> PASS +1
> 
>   * igt@kms_cursor_crc@cursor-256x256-random:
>     - shard-glk:          FAIL [fdo#103232] -> PASS
> 
>   * igt@kms_cursor_crc@cursor-64x64-dpms:
>     - shard-kbl:          FAIL [fdo#103232] -> PASS +1
> 
>   * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-onoff:
>     - shard-apl:          FAIL [fdo#103167] -> PASS
> 
>   * igt@kms
> _frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-mmap-cpu:
>     - shard-glk:          FAIL [fdo#103167] -> PASS +6
> 
>   * igt@kms_frontbuffer_tracking@fbc-suspend:
>     - shard-kbl:          DMESG-WARN [fdo#103558] / [fdo#105602] ->
> PASS +16
> 
>   * igt@kms_plane@plane-position-covered-pipe-c-planes:
>     - shard-kbl:          FAIL [fdo#103166] -> PASS
> 
>   * igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max:
>     - shard-glk:          FAIL [fdo#108145] -> PASS +2
> 
>   * igt@kms_plane_multiple@atomic-pipe-b-tiling-x:
>     - shard-glk:          FAIL [fdo#103166] -> PASS +2
> 
>   * igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
>     - shard-apl:          FAIL [fdo#103166] -> PASS +1
> 
>   * igt@kms_rotation_crc@multiplane-rotation-cropping-top:
>     - shard-glk:          DMESG-FAIL [fdo#105763] / [fdo#106538] ->
> PASS
> 
>   * igt@pm_rc6_residency@rc6-accuracy:
>     - shard-snb:          {SKIP} [fdo#109271] -> PASS
> 
>   
>   {name}: This element is suppressed. This means it is ignored when
> computing
>           the status of the difference (SUCCESS, WARNING, or
> FAILURE).
> 
>   [fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
>   [fdo#103060]: https://bugs.freedesktop.org/show_bug.cgi?id=103060
>   [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
>   [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
>   [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
>   [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
>   [fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
>   [fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
>   [fdo#105454]: https://bugs.freedesktop.org/show_bug.cgi?id=105454
>   [fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
>   [fdo#105682]: https://bugs.freedesktop.org/show_bug.cgi?id=105682
>   [fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
>   [fdo#106538]: https://bugs.freedesktop.org/show_bug.cgi?id=106538
>   [fdo#106641]: https://bugs.freedesktop.org/show_bug.cgi?id=106641
>   [fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
>   [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
>   [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
>   [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
>   [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
> 
> 
> Participating hosts (7 -> 5)
> ------------------------------
> 
>   Missing    (2): shard-skl shard-iclb 
> 
> 
> Build changes
> -------------
> 
>     * IGT: IGT_4764 -> IGTPW_2227
>     * Piglit: piglit_4509 -> None
> 
>   CI_DRM_5408: bd0d0bbe6b5a740429be306d7eea41703daf08cc @
> git://anongit.freedesktop.org/gfx-ci/linux
>   IGTPW_2227: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2227/
>   IGT_4764: db19bccc1c220884baf2136e41683a3c2ba6aa24 @
> git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
>   piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @
> git://anongit.freedesktop.org/piglit
> 
> == Logs ==
> 
> For more details see: 
> https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2227/