Skip to contentSkip to conversation

drm/i915/debugfs: store rotation string buffer on stack

PATCH In review Jani Nikula 3 participants 5 messages Jan 7, 2019 – Jan 8, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/debugfs: store rotation string buffer on stack

Minimal change to nuke the static buf.

---
 drivers/gpu/drm/i915/i915_debugfs.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +6 -6
index c77326a7d058..95813e21ae02 100644
@@ -2961,14 +2961,13 @@ static const char *plane_type(enum drm_plane_type type)
 	return "unknown";
 }
 
-static const char *plane_rotation(unsigned int rotation)
+static void plane_rotation(char *buf, size_t bufsize, unsigned int rotation)
 {
-	static char buf[48];
 	/*
 	 * According to doc only one DRM_MODE_ROTATE_ is allowed but this
 	 * will print them all to visualize if the values are misused
 	 */
-	snprintf(buf, sizeof(buf),
+	snprintf(buf, bufsize,
 		 "%s%s%s%s%s%s(0x%08x)",
 		 (rotation & DRM_MODE_ROTATE_0) ? "0 " : "",
 		 (rotation & DRM_MODE_ROTATE_90) ? "90 " : "",
@@ -2977,8 +2976,6 @@ static const char *plane_rotation(unsigned int rotation)
 		 (rotation & DRM_MODE_REFLECT_X) ? "FLIPX " : "",
 		 (rotation & DRM_MODE_REFLECT_Y) ? "FLIPY " : "",
 		 rotation);
-
-	return buf;
 }
 
 static void intel_plane_info(struct seq_file *m, struct intel_crtc *intel_crtc)
@@ -2991,6 +2988,7 @@ static void intel_plane_info(struct seq_file *m, struct intel_crtc *intel_crtc)
 		struct drm_plane_state *state;
 		struct drm_plane *plane = &intel_plane->base;
 		struct drm_format_name_buf format_name;
+		char rot_str[48];
 
 		if (!plane->state) {
 			seq_puts(m, "plane->state is NULL!\n");
@@ -3006,6 +3004,8 @@ static void intel_plane_info(struct seq_file *m, struct intel_crtc *intel_crtc)
 			sprintf(format_name.str, "N/A");
 		}
 
+		plane_rotation(rot_str, sizeof(rot_str), state->rotation);
+
 		seq_printf(m, "\t--Plane id %d: type=%s, crtc_pos=%4dx%4d, crtc_size=%4dx%4d, src_pos=%d.%04ux%d.%04u, src_size=%d.%04ux%d.%04u, format=%s, rotation=%s\n",
 			   plane->base.id,
 			   plane_type(intel_plane->base.type),
@@ -3020,7 +3020,7 @@ static void intel_plane_info(struct seq_file *m, struct intel_crtc *intel_crtc)
 			   (state->src_h >> 16),
 			   ((state->src_h & 0xffff) * 15625) >> 10,
 			   format_name.str,
-			   plane_rotation(state->rotation));
+			   rot_str);
 	}
 }
 
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 6 lines · Chris Wilson

Quoting Jani Nikula (2019-01-07 14:51:49)

Quoted 3 lines

Minimal change to nuke the static buf.

I'm sure there's a grander plan,

Thanks for the review, pushed before you realize there might not be a grander plan. ;)

BR,
Jani.

Quoted 2 lines

-Chris

Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

✓ Fi.CI.BAT: success for drm/i915/debugfs: store rotation string buffer on stack

In reply to Jani Nikula
== Series Details ==

== Series Details ==

Series: drm/i915/debugfs: store rotation string buffer on stack
URL : https://patchwork.freedesktop.org/series/54816/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5369 -> Patchwork_11201
====================================================

Summary
-------

**WARNING**

Minor unknown changes coming with Patchwork_11201 need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_11201, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/54816/revisions/1/mbox/

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_11201:

### IGT changes ###

#### Warnings ####

* igt@pm_rpm@basic-pci-d3-state:
- fi-byt-j1900: PASS -> SKIP

Known issues
------------

Here are the changes found in Patchwork_11201 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@kms_busy@basic-flip-b:
- fi-gdg-551: PASS -> FAIL [fdo#103182]

* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: PASS -> FAIL [fdo#108767]

* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a-frame-sequence:
- fi-byt-clapper: PASS -> FAIL [fdo#103191] / [fdo#107362]

* igt@pm_rpm@basic-rte:
- fi-byt-j1900: PASS -> FAIL [fdo#108800]

#### Possible fixes ####

* igt@gem_mmap_gtt@basic-small-copy:
- fi-glk-dsi: INCOMPLETE [fdo#103359] / [k.org#198133] -> PASS

* igt@i915_selftest@live_coherency:
- fi-gdg-551: DMESG-FAIL [fdo#107164] -> PASS

* igt@i915_selftest@live_hangcheck:
- fi-bwr-2160: DMESG-FAIL [fdo#108735] -> PASS

* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
- fi-blb-e6850: INCOMPLETE [fdo#107718] -> PASS

* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
- fi-cfl-8109u: INCOMPLETE [fdo#106070] / [fdo#108126] -> PASS

[fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
[fdo#106070]: https://bugs.freedesktop.org/show_bug.cgi?id=106070
[fdo#107164]: https://bugs.freedesktop.org/show_bug.cgi?id=107164
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#108126]: https://bugs.freedesktop.org/show_bug.cgi?id=108126
[fdo#108735]: https://bugs.freedesktop.org/show_bug.cgi?id=108735
[fdo#108767]: https://bugs.freedesktop.org/show_bug.cgi?id=108767
[fdo#108800]: https://bugs.freedesktop.org/show_bug.cgi?id=108800
[k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133

Participating hosts (49 -> 44)
------------------------------

Additional (1): fi-pnv-d510
Missing (6): fi-kbl-soraka fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-apl-guc fi-kbl-8809g

Build changes
-------------

* Linux: CI_DRM_5369 -> Patchwork_11201

CI_DRM_5369: 4d637a8d160356f01d22695ec1a76858bfb55758 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4756: 75081c6bfb9998bd7cbf35a7ac0578c683fe55a8 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_11201: 67c358d496e5d191638e2ee97224f3dfdd70c602 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

67c358d496e5 drm/i915/debugfs: store rotation string buffer on stack

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_11201/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

✓ Fi.CI.IGT: success for drm/i915/debugfs: store rotation string buffer on stack

In reply to Jani Nikula
== Series Details ==

== Series Details ==

Series: drm/i915/debugfs: store rotation string buffer on stack
URL : https://patchwork.freedesktop.org/series/54816/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5369_full -> Patchwork_11201_full
====================================================

Summary
-------

**WARNING**

Minor unknown changes coming with Patchwork_11201_full need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_11201_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_11201_full:

### IGT changes ###

#### Warnings ####

* igt@pm_rc6_residency@rc6-accuracy:
- shard-kbl: PASS -> SKIP

Known issues
------------

Here are the changes found in Patchwork_11201_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_ppgtt@blt-vs-render-ctx0:
- shard-skl: NOTRUN -> TIMEOUT [fdo#108039]

* igt@kms_atomic_transition@plane-all-modeset-transition-internal-panels:
- shard-iclb: PASS -> DMESG-WARN [fdo#107724] +4

* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
- shard-skl: NOTRUN -> DMESG-WARN [fdo#107956] +2

* igt@kms_color@pipe-b-legacy-gamma:
- shard-apl: PASS -> FAIL [fdo#104782]

* igt@kms_cursor_crc@cursor-128x128-sliding:
- shard-iclb: NOTRUN -> FAIL [fdo#103232]

* igt@kms_cursor_crc@cursor-128x128-suspend:
- shard-apl: PASS -> FAIL [fdo#103191] / [fdo#103232] +1

* igt@kms_cursor_crc@cursor-256x85-random:
- shard-apl: PASS -> FAIL [fdo#103232] +1

* igt@kms_fbcon_fbt@psr-suspend:
- shard-iclb: NOTRUN -> FAIL [fdo#107882]

* igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
- shard-glk: PASS -> FAIL [fdo#105363]

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
- shard-apl: PASS -> FAIL [fdo#103167] +2

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
- shard-iclb: PASS -> FAIL [fdo#103167] +9

* igt@kms_plane@pixel-format-pipe-b-planes-source-clamping:
- shard-skl: NOTRUN -> DMESG-WARN [fdo#106885]

* igt@kms_plane@pixel-format-pipe-c-planes-source-clamping:
- shard-apl: PASS -> FAIL [fdo#108948]

* igt@kms_plane@plane-position-covered-pipe-b-planes:
- shard-iclb: PASS -> FAIL [fdo#103166] +1

* igt@kms_plane_alpha_blend@pipe-a-alpha-transparant-fb:
- shard-skl: NOTRUN -> FAIL [fdo#108145]

* igt@kms_plane_alpha_blend@pipe-b-alpha-7efc:
- shard-iclb: PASS -> DMESG-WARN [fdo#107724] / [fdo#108336] +1

* igt@kms_plane_alpha_blend@pipe-c-alpha-transparant-fb:
- shard-iclb: PASS -> DMESG-FAIL [fdo#107724]

* igt@kms_plane_multiple@atomic-pipe-c-tiling-x:
- shard-apl: PASS -> FAIL [fdo#103166] +1

* igt@kms_rotation_crc@multiplane-rotation-cropping-top:
- shard-kbl: PASS -> DMESG-FAIL [fdo#108950]

* igt@kms_setmode@basic:
- shard-hsw: PASS -> FAIL [fdo#99912]

* igt@pm_rpm@gem-idle:
- shard-iclb: PASS -> INCOMPLETE [fdo#107713] / [fdo#108840]

* igt@pm_rpm@i2c:
- shard-skl: PASS -> INCOMPLETE [fdo#107807]

#### Possible fixes ####

* igt@gem_exec_suspend@basic-s4-devices:
- shard-kbl: DMESG-WARN [fdo#103558] / [fdo#105602] / [fdo#107139] -> PASS

* igt@gem_userptr_blits@readonly-unsync:
- shard-skl: TIMEOUT [fdo#108887] -> PASS

* igt@kms_busy@extended-pageflip-hang-newfb-render-b:
- shard-glk: DMESG-WARN [fdo#107956] -> PASS

* igt@kms_chv_cursor_fail@pipe-b-64x64-left-edge:
- shard-skl: FAIL [fdo#104671] -> PASS

* igt@kms_cursor_crc@cursor-256x256-sliding:
- shard-skl: FAIL [fdo#103232] -> PASS

* igt@kms_cursor_crc@cursor-256x85-onscreen:
- shard-apl: FAIL [fdo#103232] -> PASS

* igt@kms_cursor_crc@cursor-64x64-suspend:
- shard-apl: FAIL [fdo#103191] / [fdo#103232] -> PASS

* igt@kms_flip@flip-vs-expired-vblank:
- shard-skl: FAIL [fdo#105363] -> PASS

* igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-blt:
- shard-glk: FAIL [fdo#103167] -> PASS

* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-mmap-wc:
- shard-iclb: FAIL [fdo#103167] -> PASS +1

* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c:
- shard-skl: FAIL [fdo#107362] -> PASS

* igt@kms_plane@plane-panning-bottom-right-pipe-b-planes:
- shard-skl: FAIL [fdo#103166] -> PASS

* igt@kms_plane@plane-position-covered-pipe-b-planes:
- shard-glk: FAIL [fdo#103166] -> PASS +1

* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: FAIL [fdo#107815] -> PASS +1

* igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
- shard-apl: FAIL [fdo#103166] -> PASS +2

* igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
- shard-iclb: FAIL [fdo#103166] -> PASS

* igt@kms_plane_scaling@pipe-a-scaler-with-pixel-format:
- shard-iclb: DMESG-WARN [fdo#107724] -> PASS

* igt@kms_setmode@basic:
- shard-kbl: FAIL [fdo#99912] -> PASS

* igt@kms_vblank@pipe-c-ts-continuation-modeset-rpm:
- shard-kbl: DMESG-WARN [fdo#103558] / [fdo#105602] -> PASS +2

* igt@perf@rc6-disable:
- shard-kbl: FAIL [fdo#103179] -> PASS

* igt@pm_rpm@modeset-non-lpsp-stress:
- shard-skl: INCOMPLETE [fdo#107807] -> SKIP

* igt@pm_rpm@reg-read-ioctl:
- shard-skl: INCOMPLETE [fdo#107807] -> PASS

* igt@pm_rps@min-max-config-loaded:
- shard-skl: FAIL [fdo#102250] -> PASS
- shard-glk: FAIL [fdo#102250] -> PASS

* igt@prime_vgem@basic-fence-flip:
- shard-apl: FAIL [fdo#104008] -> PASS

#### Warnings ####

* igt@kms_rotation_crc@multiplane-rotation-cropping-top:
- shard-glk: DMESG-FAIL [fdo#105763] / [fdo#106538] -> DMESG-WARN [fdo#105763] / [fdo#106538]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#102250]: https://bugs.freedesktop.org/show_bug.cgi?id=102250
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103179]: https://bugs.freedesktop.org/show_bug.cgi?id=103179
[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#104008]: https://bugs.freedesktop.org/show_bug.cgi?id=104008
[fdo#104671]: https://bugs.freedesktop.org/show_bug.cgi?id=104671
[fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
[fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
[fdo#106538]: https://bugs.freedesktop.org/show_bug.cgi?id=106538
[fdo#106885]: https://bugs.freedesktop.org/show_bug.cgi?id=106885
[fdo#107139]: https://bugs.freedesktop.org/show_bug.cgi?id=107139
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#107469]: https://bugs.freedesktop.org/show_bug.cgi?id=107469
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807
[fdo#107815]: https://bugs.freedesktop.org/show_bug.cgi?id=107815
[fdo#107882]: https://bugs.freedesktop.org/show_bug.cgi?id=107882
[fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
[fdo#108039]: https://bugs.freedesktop.org/show_bug.cgi?id=108039
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108336]: https://bugs.freedesktop.org/show_bug.cgi?id=108336
[fdo#108784]: https://bugs.freedesktop.org/show_bug.cgi?id=108784
[fdo#108840]: https://bugs.freedesktop.org/show_bug.cgi?id=108840
[fdo#108887]: https://bugs.freedesktop.org/show_bug.cgi?id=108887
[fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948
[fdo#108950]: https://bugs.freedesktop.org/show_bug.cgi?id=108950
[fdo#109241]: https://bugs.freedesktop.org/show_bug.cgi?id=109241
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912

Participating hosts (7 -> 7)
------------------------------

No changes in participating hosts

Build changes
-------------

* Linux: CI_DRM_5369 -> Patchwork_11201

CI_DRM_5369: 4d637a8d160356f01d22695ec1a76858bfb55758 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4756: 75081c6bfb9998bd7cbf35a7ac0578c683fe55a8 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_11201: 67c358d496e5d191638e2ee97224f3dfdd70c602 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_11201/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx