All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function
@ 2019-09-30  9:06 brandon.hong
  2019-09-30  9:16 ` [igt-dev] ✗ GitLab.Pipeline: warning for Fix global symbol loading failure in resolve function (rev3) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: brandon.hong @ 2019-09-30  9:06 UTC (permalink / raw)
  To: igt-dev

From: Brandon Hong <brandon.hong@intel.com>

270 out of 284 tests get failed with SIGSEGV on ClearLinux because the ifunc
resolver resolve_half_to_float() tries to call unbound global function
igt_x86_features(). This patch fixes the issue by adding a F16C checking
local function.

Signed-off-by: Brandon Hong <brandon.hong@intel.com>
---
 lib/igt_halffloat.c | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/lib/igt_halffloat.c b/lib/igt_halffloat.c
index 08ab05fc..ec365829 100644
--- a/lib/igt_halffloat.c
+++ b/lib/igt_halffloat.c
@@ -24,6 +24,15 @@
 
 #include <assert.h>
 #include <math.h>
+#include <stdbool.h>
+
+#ifdef HAVE_CPUID_H
+#include <cpuid.h>
+#else
+#define __get_cpuid_max(x, y) 0
+#define __cpuid(level, a, b, c, d) a = b = c = d = 0
+#define __cpuid_count(level, count, a, b, c, d) a = b = c = d = 0
+#endif
 
 #include "igt_halffloat.h"
 #include "igt_x86.h"
@@ -182,6 +191,20 @@ static void half_to_float_f16c(const uint16_t *h, float *f, unsigned int num)
 
 #pragma GCC pop_options
 
+static bool f16c_is_supported(void)
+{
+	unsigned max = __get_cpuid_max(0, NULL);
+	unsigned eax, ebx, ecx, edx;
+
+	if (max >= 1) {
+		__cpuid(1, eax, ebx, ecx, edx);
+
+		if (ecx & bit_F16C)
+			return true;
+	}
+	return false;
+}
+
 static void float_to_half(const float *f, uint16_t *h, unsigned int num)
 {
 	for (int i = 0; i < num; i++)
@@ -196,7 +219,7 @@ static void half_to_float(const uint16_t *h, float *f, unsigned int num)
 
 static void (*resolve_float_to_half(void))(const float *f, uint16_t *h, unsigned int num)
 {
-	if (igt_x86_features() & F16C)
+	if (f16c_is_supported())
 		return float_to_half_f16c;
 
 	return float_to_half;
@@ -207,7 +230,7 @@ void igt_float_to_half(const float *f, uint16_t *h, unsigned int num)
 
 static void (*resolve_half_to_float(void))(const uint16_t *h, float *f, unsigned int num)
 {
-	if (igt_x86_features() & F16C)
+	if (f16c_is_supported())
 		return half_to_float_f16c;
 
 	return half_to_float;
-- 
2.23.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [igt-dev] ✗ GitLab.Pipeline: warning for Fix global symbol loading failure in resolve function (rev3)
  2019-09-30  9:06 [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function brandon.hong
@ 2019-09-30  9:16 ` Patchwork
  2019-09-30  9:32 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
  2019-09-30 10:38 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  2 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2019-09-30  9:16 UTC (permalink / raw)
  To: brandon.hong; +Cc: igt-dev

== Series Details ==

Series: Fix global symbol loading failure in resolve function (rev3)
URL   : https://patchwork.freedesktop.org/series/67150/
State : warning

== Summary ==

Did not get list of undocumented tests for this run, something is wrong!

Other than that, pipeline status: FAILED.

see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/67366 for more details

== Logs ==

For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/67366
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for Fix global symbol loading failure in resolve function (rev3)
  2019-09-30  9:06 [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function brandon.hong
  2019-09-30  9:16 ` [igt-dev] ✗ GitLab.Pipeline: warning for Fix global symbol loading failure in resolve function (rev3) Patchwork
@ 2019-09-30  9:32 ` Patchwork
  2019-09-30 10:38 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  2 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2019-09-30  9:32 UTC (permalink / raw)
  To: brandon.hong; +Cc: igt-dev

== Series Details ==

Series: Fix global symbol loading failure in resolve function (rev3)
URL   : https://patchwork.freedesktop.org/series/67150/
State : success

== Summary ==

CI Bug Log - changes from IGT_5207 -> IGTPW_3510
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/67150/revisions/3/mbox/

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

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

### IGT changes ###

#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@i915_module_load@reload-with-fault-injection:
    - {fi-tgl-u2}:        [PASS][1] -> [INCOMPLETE][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/fi-tgl-u2/igt@i915_module_load@reload-with-fault-injection.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/fi-tgl-u2/igt@i915_module_load@reload-with-fault-injection.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_module_load@reload:
    - fi-icl-u3:          [PASS][3] -> [DMESG-WARN][4] ([fdo#107724] / [fdo#111214])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/fi-icl-u3/igt@i915_module_load@reload.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/fi-icl-u3/igt@i915_module_load@reload.html

  * igt@i915_selftest@live_sanitycheck:
    - fi-icl-u3:          [PASS][5] -> [DMESG-WARN][6] ([fdo#107724]) +2 similar issues
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/fi-icl-u3/igt@i915_selftest@live_sanitycheck.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/fi-icl-u3/igt@i915_selftest@live_sanitycheck.html

  
#### Possible fixes ####

  * igt@gem_ctx_create@basic-files:
    - fi-bxt-dsi:         [INCOMPLETE][7] ([fdo#103927]) -> [PASS][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/fi-bxt-dsi/igt@gem_ctx_create@basic-files.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/fi-bxt-dsi/igt@gem_ctx_create@basic-files.html

  * igt@gem_ctx_switch@legacy-render:
    - fi-icl-u2:          [INCOMPLETE][9] ([fdo#107713] / [fdo#111381]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/fi-icl-u2/igt@gem_ctx_switch@legacy-render.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/fi-icl-u2/igt@gem_ctx_switch@legacy-render.html

  * igt@gem_exec_suspend@basic-s3:
    - fi-blb-e6850:       [INCOMPLETE][11] ([fdo#107718]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/fi-blb-e6850/igt@gem_exec_suspend@basic-s3.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/fi-blb-e6850/igt@gem_exec_suspend@basic-s3.html

  * igt@gem_workarounds@basic-read:
    - fi-icl-u3:          [DMESG-WARN][13] ([fdo#107724]) -> [PASS][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/fi-icl-u3/igt@gem_workarounds@basic-read.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/fi-icl-u3/igt@gem_workarounds@basic-read.html

  * igt@i915_selftest@live_hangcheck:
    - {fi-icl-guc}:       [INCOMPLETE][15] ([fdo#107713] / [fdo#108569]) -> [PASS][16]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/fi-icl-guc/igt@i915_selftest@live_hangcheck.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/fi-icl-guc/igt@i915_selftest@live_hangcheck.html

  * igt@kms_frontbuffer_tracking@basic:
    - fi-icl-u3:          [FAIL][17] ([fdo#103167]) -> [PASS][18]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/fi-icl-u3/igt@kms_frontbuffer_tracking@basic.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/fi-icl-u3/igt@kms_frontbuffer_tracking@basic.html

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

  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#111214]: https://bugs.freedesktop.org/show_bug.cgi?id=111214
  [fdo#111381]: https://bugs.freedesktop.org/show_bug.cgi?id=111381


Participating hosts (52 -> 46)
------------------------------

  Additional (2): fi-bdw-5557u fi-bwr-2160 
  Missing    (8): fi-ilk-m540 fi-hsw-4200u fi-skl-6770hq fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5207 -> IGTPW_3510

  CI-20190529: 20190529
  CI_DRM_6973: 7462c58bba0fb6e85bd380591c3fd86e298c0f95 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3510: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/index.html
  IGT_5207: 9759822c53fa79b3758dd22cf1ac05b8832b29a9 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [igt-dev] ✗ Fi.CI.IGT: failure for Fix global symbol loading failure in resolve function (rev3)
  2019-09-30  9:06 [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function brandon.hong
  2019-09-30  9:16 ` [igt-dev] ✗ GitLab.Pipeline: warning for Fix global symbol loading failure in resolve function (rev3) Patchwork
  2019-09-30  9:32 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
@ 2019-09-30 10:38 ` Patchwork
  2 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2019-09-30 10:38 UTC (permalink / raw)
  To: brandon.hong; +Cc: igt-dev

== Series Details ==

Series: Fix global symbol loading failure in resolve function (rev3)
URL   : https://patchwork.freedesktop.org/series/67150/
State : failure

== Summary ==

CI Bug Log - changes from IGT_5207_full -> IGTPW_3510_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_3510_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_3510_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://patchwork.freedesktop.org/api/1.0/series/67150/revisions/3/mbox/

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@gem_eio@in-flight-suspend:
    - shard-iclb:         [PASS][1] -> [DMESG-WARN][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-iclb2/igt@gem_eio@in-flight-suspend.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-iclb3/igt@gem_eio@in-flight-suspend.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_switch@legacy-bsd2-heavy:
    - shard-iclb:         [PASS][3] -> [SKIP][4] ([fdo#109276]) +16 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-iclb1/igt@gem_ctx_switch@legacy-bsd2-heavy.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-iclb7/igt@gem_ctx_switch@legacy-bsd2-heavy.html

  * igt@gem_exec_schedule@preemptive-hang-bsd:
    - shard-iclb:         [PASS][5] -> [SKIP][6] ([fdo#111325]) +2 similar issues
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-iclb8/igt@gem_exec_schedule@preemptive-hang-bsd.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-iclb1/igt@gem_exec_schedule@preemptive-hang-bsd.html

  * igt@gem_tiled_swapping@non-threaded:
    - shard-glk:          [PASS][7] -> [DMESG-WARN][8] ([fdo#108686])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-glk2/igt@gem_tiled_swapping@non-threaded.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-glk4/igt@gem_tiled_swapping@non-threaded.html

  * igt@gem_workarounds@suspend-resume:
    - shard-apl:          [PASS][9] -> [DMESG-WARN][10] ([fdo#108566]) +6 similar issues
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-apl6/igt@gem_workarounds@suspend-resume.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-apl3/igt@gem_workarounds@suspend-resume.html

  * igt@kms_cursor_legacy@pipe-b-single-bo:
    - shard-apl:          [PASS][11] -> [INCOMPLETE][12] ([fdo#103927]) +2 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-apl3/igt@kms_cursor_legacy@pipe-b-single-bo.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-apl4/igt@kms_cursor_legacy@pipe-b-single-bo.html

  * igt@kms_flip@flip-vs-suspend:
    - shard-hsw:          [PASS][13] -> [INCOMPLETE][14] ([fdo#103540]) +1 similar issue
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-hsw6/igt@kms_flip@flip-vs-suspend.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-hsw4/igt@kms_flip@flip-vs-suspend.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-pwrite:
    - shard-snb:          [PASS][15] -> [SKIP][16] ([fdo#109271])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-snb5/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-pwrite.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-snb1/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-pwrite.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-pwrite:
    - shard-iclb:         [PASS][17] -> [FAIL][18] ([fdo#103167]) +9 similar issues
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-iclb3/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-pwrite.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-iclb1/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-pwrite.html

  * igt@kms_plane_lowres@pipe-a-tiling-y:
    - shard-iclb:         [PASS][19] -> [FAIL][20] ([fdo#103166])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-iclb4/igt@kms_plane_lowres@pipe-a-tiling-y.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-iclb5/igt@kms_plane_lowres@pipe-a-tiling-y.html

  * igt@kms_psr@psr2_primary_page_flip:
    - shard-iclb:         [PASS][21] -> [SKIP][22] ([fdo#109441]) +1 similar issue
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-iclb2/igt@kms_psr@psr2_primary_page_flip.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-iclb7/igt@kms_psr@psr2_primary_page_flip.html

  * igt@kms_vblank@pipe-b-ts-continuation-suspend:
    - shard-kbl:          [PASS][23] -> [INCOMPLETE][24] ([fdo#103665])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-kbl4/igt@kms_vblank@pipe-b-ts-continuation-suspend.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-kbl3/igt@kms_vblank@pipe-b-ts-continuation-suspend.html

  
#### Possible fixes ####

  * igt@gem_bad_reloc@negative-reloc-bsd2:
    - shard-iclb:         [SKIP][25] ([fdo#109276]) -> [PASS][26] +13 similar issues
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-iclb5/igt@gem_bad_reloc@negative-reloc-bsd2.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-iclb1/igt@gem_bad_reloc@negative-reloc-bsd2.html

  * igt@gem_ctx_isolation@vcs0-s3:
    - shard-apl:          [DMESG-WARN][27] ([fdo#108566]) -> [PASS][28] +1 similar issue
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-apl2/igt@gem_ctx_isolation@vcs0-s3.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-apl5/igt@gem_ctx_isolation@vcs0-s3.html

  * igt@gem_ctx_shared@exec-single-timeline-bsd:
    - shard-iclb:         [SKIP][29] ([fdo#110841]) -> [PASS][30]
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-iclb4/igt@gem_ctx_shared@exec-single-timeline-bsd.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-iclb6/igt@gem_ctx_shared@exec-single-timeline-bsd.html

  * igt@gem_exec_schedule@preempt-other-chain-bsd:
    - shard-iclb:         [SKIP][31] ([fdo#111325]) -> [PASS][32] +6 similar issues
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-iclb2/igt@gem_exec_schedule@preempt-other-chain-bsd.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-iclb6/igt@gem_exec_schedule@preempt-other-chain-bsd.html

  * {igt@i915_pm_dc@dc6-psr}:
    - shard-iclb:         [FAIL][33] ([fdo#110548]) -> [PASS][34]
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-iclb3/igt@i915_pm_dc@dc6-psr.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-iclb5/igt@i915_pm_dc@dc6-psr.html

  * igt@kms_cursor_crc@pipe-a-cursor-64x21-sliding:
    - shard-apl:          [FAIL][35] ([fdo#103232]) -> [PASS][36] +1 similar issue
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-apl8/igt@kms_cursor_crc@pipe-a-cursor-64x21-sliding.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-apl3/igt@kms_cursor_crc@pipe-a-cursor-64x21-sliding.html
    - shard-kbl:          [FAIL][37] ([fdo#103232]) -> [PASS][38] +1 similar issue
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-kbl7/igt@kms_cursor_crc@pipe-a-cursor-64x21-sliding.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-kbl7/igt@kms_cursor_crc@pipe-a-cursor-64x21-sliding.html

  * igt@kms_cursor_legacy@short-flip-before-cursor-atomic-transitions-varying-size:
    - shard-snb:          [SKIP][39] ([fdo#109271]) -> [PASS][40] +1 similar issue
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-snb5/igt@kms_cursor_legacy@short-flip-before-cursor-atomic-transitions-varying-size.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-snb2/igt@kms_cursor_legacy@short-flip-before-cursor-atomic-transitions-varying-size.html

  * igt@kms_flip@2x-flip-vs-suspend-interruptible:
    - shard-hsw:          [INCOMPLETE][41] ([fdo#103540]) -> [PASS][42]
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-hsw2/igt@kms_flip@2x-flip-vs-suspend-interruptible.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-hsw4/igt@kms_flip@2x-flip-vs-suspend-interruptible.html

  * igt@kms_flip@flip-vs-suspend:
    - shard-snb:          [INCOMPLETE][43] ([fdo#105411]) -> [PASS][44]
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-snb1/igt@kms_flip@flip-vs-suspend.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-snb2/igt@kms_flip@flip-vs-suspend.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-shrfb-plflip-blt:
    - shard-iclb:         [FAIL][45] ([fdo#103167]) -> [PASS][46] +3 similar issues
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-iclb7/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-shrfb-plflip-blt.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-iclb5/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-shrfb-plflip-blt.html

  * igt@kms_psr@psr2_primary_mmap_cpu:
    - shard-iclb:         [SKIP][47] ([fdo#109441]) -> [PASS][48] +3 similar issues
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-iclb3/igt@kms_psr@psr2_primary_mmap_cpu.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html

  
#### Warnings ####

  * igt@gem_mocs_settings@mocs-settings-bsd2:
    - shard-iclb:         [SKIP][49] ([fdo#109276]) -> [FAIL][50] ([fdo#111330])
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-iclb3/igt@gem_mocs_settings@mocs-settings-bsd2.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-iclb2/igt@gem_mocs_settings@mocs-settings-bsd2.html

  * igt@kms_vblank@pipe-c-wait-busy-hang:
    - shard-snb:          [SKIP][51] ([fdo#109271]) -> [SKIP][52] ([fdo#109271] / [fdo#109278])
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5207/shard-snb5/igt@kms_vblank@pipe-c-wait-busy-hang.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/shard-snb4/igt@kms_vblank@pipe-c-wait-busy-hang.html

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

  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
  [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
  [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
  [fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#110548]: https://bugs.freedesktop.org/show_bug.cgi?id=110548
  [fdo#110841]: https://bugs.freedesktop.org/show_bug.cgi?id=110841
  [fdo#111325]: https://bugs.freedesktop.org/show_bug.cgi?id=111325
  [fdo#111330]: https://bugs.freedesktop.org/show_bug.cgi?id=111330
  [fdo#111781]: https://bugs.freedesktop.org/show_bug.cgi?id=111781
  [fdo#111795 ]: https://bugs.freedesktop.org/show_bug.cgi?id=111795 


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

  Missing    (1): shard-skl 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5207 -> IGTPW_3510

  CI-20190529: 20190529
  CI_DRM_6973: 7462c58bba0fb6e85bd380591c3fd86e298c0f95 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3510: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/index.html
  IGT_5207: 9759822c53fa79b3758dd22cf1ac05b8832b29a9 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3510/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function
@ 2019-09-30  9:30 brandon.hong
  0 siblings, 0 replies; 11+ messages in thread
From: brandon.hong @ 2019-09-30  9:30 UTC (permalink / raw)
  To: igt-dev

From: Brandon Hong <brandon.hong@intel.com>

270 out of 284 tests get failed with SIGSEGV on ClearLinux because the ifunc
resolver resolve_half_to_float() tries to call unbound global function
igt_x86_features(). This patch fixes the issue by adding a F16C checking
local function.

Signed-off-by: Brandon Hong <brandon.hong@intel.com>
---
 lib/igt_halffloat.c | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/lib/igt_halffloat.c b/lib/igt_halffloat.c
index 08ab05fc..e5e8a5bd 100644
--- a/lib/igt_halffloat.c
+++ b/lib/igt_halffloat.c
@@ -24,6 +24,19 @@
 
 #include <assert.h>
 #include <math.h>
+#include <stdbool.h>
+
+#ifdef HAVE_CPUID_H
+#include <cpuid.h>
+#else
+#define __get_cpuid_max(x, y) 0
+#define __cpuid(level, a, b, c, d) a = b = c = d = 0
+#define __cpuid_count(level, count, a, b, c, d) a = b = c = d = 0
+#endif
+
+#ifndef bit_F16C
+#define bit_F16C	(1 << 29)
+#endif
 
 #include "igt_halffloat.h"
 #include "igt_x86.h"
@@ -182,6 +195,20 @@ static void half_to_float_f16c(const uint16_t *h, float *f, unsigned int num)
 
 #pragma GCC pop_options
 
+static bool f16c_is_supported(void)
+{
+	unsigned max = __get_cpuid_max(0, NULL);
+	unsigned eax, ebx, ecx, edx;
+
+	if (max >= 1) {
+		__cpuid(1, eax, ebx, ecx, edx);
+
+		if (ecx & bit_F16C)
+			return true;
+	}
+	return false;
+}
+
 static void float_to_half(const float *f, uint16_t *h, unsigned int num)
 {
 	for (int i = 0; i < num; i++)
@@ -196,7 +223,7 @@ static void half_to_float(const uint16_t *h, float *f, unsigned int num)
 
 static void (*resolve_float_to_half(void))(const float *f, uint16_t *h, unsigned int num)
 {
-	if (igt_x86_features() & F16C)
+	if (f16c_is_supported())
 		return float_to_half_f16c;
 
 	return float_to_half;
@@ -207,7 +234,7 @@ void igt_float_to_half(const float *f, uint16_t *h, unsigned int num)
 
 static void (*resolve_half_to_float(void))(const uint16_t *h, float *f, unsigned int num)
 {
-	if (igt_x86_features() & F16C)
+	if (f16c_is_supported())
 		return half_to_float_f16c;
 
 	return half_to_float;
-- 
2.23.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function
  2019-09-27 17:26 ` Ville Syrjälä
@ 2019-09-30  9:04   ` Hong, Brandon
  0 siblings, 0 replies; 11+ messages in thread
From: Hong, Brandon @ 2019-09-30  9:04 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: igt-dev



> On 28 Sep 2019, at 2:26 AM, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> 
> On Tue, Sep 24, 2019 at 10:02:29PM +0800, brandon.hong@intel.com wrote:
>> From: Brandon Hong <brandon.hong@intel.com>
>> 
>> 270 out of 284 tests get failed with SIGSEGV on ClearLinux because the ifunc
>> resolver resolve_half_to_float() tries to call unbound global function
>> igt_x86_features(). This patch fixes the issue by adding a F16C checking
>> local function.
> 
> The rules for this stuff seem to be poorly documented. But I did find
> some docs that support this. So generally lgtm, just a few nitpicks
> below…
> 
>> 
>> Signed-off-by: Brandon Hong <brandon.hong@intel.com>
>> ---
>> lib/igt_halffloat.c | 22 ++++++++++++++++++++--
>> 1 file changed, 20 insertions(+), 2 deletions(-)
>> 
>> diff --git a/lib/igt_halffloat.c b/lib/igt_halffloat.c
>> index 08ab05fc..fa7ad2e0 100644
>> --- a/lib/igt_halffloat.c
>> +++ b/lib/igt_halffloat.c
>> @@ -24,6 +24,7 @@
>> 
>> #include <assert.h>
>> #include <math.h>
>> +#include <stdbool.h>
>> 
>> #include "igt_halffloat.h"
>> #include "igt_x86.h"
>> @@ -163,6 +164,8 @@ static inline float _half_to_float(uint16_t val)
>> }
>> 
>> #if defined(__x86_64__) && !defined(__clang__)
>> +#include <cpuid.h>
> 
> igt_x86.c has HAVE_CPUID_H protection around this stuff.
> I suppose we'd want the same here?

Thanks for pointing it out. Will add HAVE_CPUID_H as same as igt_x86.c file.

> 
>> +
>> #pragma GCC push_options
>> #pragma GCC target("f16c")
>> 
>> @@ -182,6 +185,20 @@ static void half_to_float_f16c(const uint16_t *h, float *f, unsigned int num)
>> 
>> #pragma GCC pop_options
>> 
>> +static bool f16c_is_supported(void)
>> +{
>> +	unsigned max = __get_cpuid_max(0, NULL);
>> +	unsigned eax, ebx, ecx, edx;
>> +
>> +	if (max >= 1) {
>> +		__cpuid(1, eax, ebx, ecx, edx);
>> +
>> +		if (ecx & bit_F16C)
>> +			return true;
>> +	}
>> +	return false;
>> +}
>> +
>> static void float_to_half(const float *f, uint16_t *h, unsigned int num)
>> {
>> 	for (int i = 0; i < num; i++)
>> @@ -194,9 +211,10 @@ static void half_to_float(const uint16_t *h, float *f, unsigned int num)
>> 		f[i] = _half_to_float(h[i]);
>> }
>> 
>> +
> 
> Spurious newline.
Will remove it and re-submit.

> 
>> static void (*resolve_float_to_half(void))(const float *f, uint16_t *h, unsigned int num)
>> {
>> -	if (igt_x86_features() & F16C)
>> +	if (f16c_is_supported())
>> 		return float_to_half_f16c;
>> 
>> 	return float_to_half;
>> @@ -207,7 +225,7 @@ void igt_float_to_half(const float *f, uint16_t *h, unsigned int num)
>> 
>> static void (*resolve_half_to_float(void))(const uint16_t *h, float *f, unsigned int num)
>> {
>> -	if (igt_x86_features() & F16C)
>> +	if (f16c_is_supported())
>> 		return half_to_float_f16c;
>> 
>> 	return half_to_float;
>> -- 
>> 2.23.0
>> 
>> _______________________________________________
>> igt-dev mailing list
>> igt-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/igt-dev
> 
> -- 
> Ville Syrjälä
> Intel

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function
  2019-09-24 14:02 brandon.hong
@ 2019-09-27 17:26 ` Ville Syrjälä
  2019-09-30  9:04   ` Hong, Brandon
  0 siblings, 1 reply; 11+ messages in thread
From: Ville Syrjälä @ 2019-09-27 17:26 UTC (permalink / raw)
  To: brandon.hong; +Cc: igt-dev

On Tue, Sep 24, 2019 at 10:02:29PM +0800, brandon.hong@intel.com wrote:
> From: Brandon Hong <brandon.hong@intel.com>
> 
> 270 out of 284 tests get failed with SIGSEGV on ClearLinux because the ifunc
> resolver resolve_half_to_float() tries to call unbound global function
> igt_x86_features(). This patch fixes the issue by adding a F16C checking
> local function.

The rules for this stuff seem to be poorly documented. But I did find
some docs that support this. So generally lgtm, just a few nitpicks
below...

> 
> Signed-off-by: Brandon Hong <brandon.hong@intel.com>
> ---
>  lib/igt_halffloat.c | 22 ++++++++++++++++++++--
>  1 file changed, 20 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/igt_halffloat.c b/lib/igt_halffloat.c
> index 08ab05fc..fa7ad2e0 100644
> --- a/lib/igt_halffloat.c
> +++ b/lib/igt_halffloat.c
> @@ -24,6 +24,7 @@
>  
>  #include <assert.h>
>  #include <math.h>
> +#include <stdbool.h>
>  
>  #include "igt_halffloat.h"
>  #include "igt_x86.h"
> @@ -163,6 +164,8 @@ static inline float _half_to_float(uint16_t val)
>  }
>  
>  #if defined(__x86_64__) && !defined(__clang__)
> +#include <cpuid.h>

igt_x86.c has HAVE_CPUID_H protection around this stuff.
I suppose we'd want the same here?

> +
>  #pragma GCC push_options
>  #pragma GCC target("f16c")
>  
> @@ -182,6 +185,20 @@ static void half_to_float_f16c(const uint16_t *h, float *f, unsigned int num)
>  
>  #pragma GCC pop_options
>  
> +static bool f16c_is_supported(void)
> +{
> +	unsigned max = __get_cpuid_max(0, NULL);
> +	unsigned eax, ebx, ecx, edx;
> +
> +	if (max >= 1) {
> +		__cpuid(1, eax, ebx, ecx, edx);
> +
> +		if (ecx & bit_F16C)
> +			return true;
> +	}
> +	return false;
> +}
> +
>  static void float_to_half(const float *f, uint16_t *h, unsigned int num)
>  {
>  	for (int i = 0; i < num; i++)
> @@ -194,9 +211,10 @@ static void half_to_float(const uint16_t *h, float *f, unsigned int num)
>  		f[i] = _half_to_float(h[i]);
>  }
>  
> +

Spurious newline.

>  static void (*resolve_float_to_half(void))(const float *f, uint16_t *h, unsigned int num)
>  {
> -	if (igt_x86_features() & F16C)
> +	if (f16c_is_supported())
>  		return float_to_half_f16c;
>  
>  	return float_to_half;
> @@ -207,7 +225,7 @@ void igt_float_to_half(const float *f, uint16_t *h, unsigned int num)
>  
>  static void (*resolve_half_to_float(void))(const uint16_t *h, float *f, unsigned int num)
>  {
> -	if (igt_x86_features() & F16C)
> +	if (f16c_is_supported())
>  		return half_to_float_f16c;
>  
>  	return half_to_float;
> -- 
> 2.23.0
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function
  2019-09-24  8:26 ` Chris Wilson
@ 2019-09-24 14:22   ` Hong, Brandon
  0 siblings, 0 replies; 11+ messages in thread
From: Hong, Brandon @ 2019-09-24 14:22 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

Unfortunately, I do not have a clear answer why it's not bound.
I guess it's related to IFUNC lazy binding because I observed crash call stack related to glibc elf_machine_rela() and the crash didn’t happen when I call the same global function igt_x86_features() in rewritten generic FUNC igt_half_to_float() for testing.
- Brandon

> On 24 Sep 2019, at 5:26 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> 
> Quoting brandon.hong@intel.com (2019-09-24 09:02:07)
>> From: Brandon Hong <brandon.hong@intel.com>
>> 
>> 270 out of 284 tests get failed with SIGSEGV on ClearLinux because the ifunc
>> resolver resolve_half_to_float() tries to call unbound global function
>> igt_x86_features(). This patch fixes the issue by adding a F16C checking
>> local function.
> 
> So, out of curiosity, why is the global function not bound?
> -Chris

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function
@ 2019-09-24 14:02 brandon.hong
  2019-09-27 17:26 ` Ville Syrjälä
  0 siblings, 1 reply; 11+ messages in thread
From: brandon.hong @ 2019-09-24 14:02 UTC (permalink / raw)
  To: igt-dev

From: Brandon Hong <brandon.hong@intel.com>

270 out of 284 tests get failed with SIGSEGV on ClearLinux because the ifunc
resolver resolve_half_to_float() tries to call unbound global function
igt_x86_features(). This patch fixes the issue by adding a F16C checking
local function.

Signed-off-by: Brandon Hong <brandon.hong@intel.com>
---
 lib/igt_halffloat.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/lib/igt_halffloat.c b/lib/igt_halffloat.c
index 08ab05fc..fa7ad2e0 100644
--- a/lib/igt_halffloat.c
+++ b/lib/igt_halffloat.c
@@ -24,6 +24,7 @@
 
 #include <assert.h>
 #include <math.h>
+#include <stdbool.h>
 
 #include "igt_halffloat.h"
 #include "igt_x86.h"
@@ -163,6 +164,8 @@ static inline float _half_to_float(uint16_t val)
 }
 
 #if defined(__x86_64__) && !defined(__clang__)
+#include <cpuid.h>
+
 #pragma GCC push_options
 #pragma GCC target("f16c")
 
@@ -182,6 +185,20 @@ static void half_to_float_f16c(const uint16_t *h, float *f, unsigned int num)
 
 #pragma GCC pop_options
 
+static bool f16c_is_supported(void)
+{
+	unsigned max = __get_cpuid_max(0, NULL);
+	unsigned eax, ebx, ecx, edx;
+
+	if (max >= 1) {
+		__cpuid(1, eax, ebx, ecx, edx);
+
+		if (ecx & bit_F16C)
+			return true;
+	}
+	return false;
+}
+
 static void float_to_half(const float *f, uint16_t *h, unsigned int num)
 {
 	for (int i = 0; i < num; i++)
@@ -194,9 +211,10 @@ static void half_to_float(const uint16_t *h, float *f, unsigned int num)
 		f[i] = _half_to_float(h[i]);
 }
 
+
 static void (*resolve_float_to_half(void))(const float *f, uint16_t *h, unsigned int num)
 {
-	if (igt_x86_features() & F16C)
+	if (f16c_is_supported())
 		return float_to_half_f16c;
 
 	return float_to_half;
@@ -207,7 +225,7 @@ void igt_float_to_half(const float *f, uint16_t *h, unsigned int num)
 
 static void (*resolve_half_to_float(void))(const uint16_t *h, float *f, unsigned int num)
 {
-	if (igt_x86_features() & F16C)
+	if (f16c_is_supported())
 		return half_to_float_f16c;
 
 	return half_to_float;
-- 
2.23.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function
  2019-09-24  8:02 brandon.hong
@ 2019-09-24  8:26 ` Chris Wilson
  2019-09-24 14:22   ` Hong, Brandon
  0 siblings, 1 reply; 11+ messages in thread
From: Chris Wilson @ 2019-09-24  8:26 UTC (permalink / raw)
  To: brandon.hong, igt-dev

Quoting brandon.hong@intel.com (2019-09-24 09:02:07)
> From: Brandon Hong <brandon.hong@intel.com>
> 
> 270 out of 284 tests get failed with SIGSEGV on ClearLinux because the ifunc
> resolver resolve_half_to_float() tries to call unbound global function
> igt_x86_features(). This patch fixes the issue by adding a F16C checking
> local function.

So, out of curiosity, why is the global function not bound?
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function
@ 2019-09-24  8:02 brandon.hong
  2019-09-24  8:26 ` Chris Wilson
  0 siblings, 1 reply; 11+ messages in thread
From: brandon.hong @ 2019-09-24  8:02 UTC (permalink / raw)
  To: igt-dev

From: Brandon Hong <brandon.hong@intel.com>

270 out of 284 tests get failed with SIGSEGV on ClearLinux because the ifunc
resolver resolve_half_to_float() tries to call unbound global function
igt_x86_features(). This patch fixes the issue by adding a F16C checking
local function.

Signed-off-by: Brandon Hong <brandon.hong@intel.com>
---
 lib/igt_halffloat.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/lib/igt_halffloat.c b/lib/igt_halffloat.c
index 08ab05fc..17e9cf9d 100644
--- a/lib/igt_halffloat.c
+++ b/lib/igt_halffloat.c
@@ -24,6 +24,8 @@
 
 #include <assert.h>
 #include <math.h>
+#include <stdbool.h>
+#include <cpuid.h>
 
 #include "igt_halffloat.h"
 #include "igt_x86.h"
@@ -182,6 +184,20 @@ static void half_to_float_f16c(const uint16_t *h, float *f, unsigned int num)
 
 #pragma GCC pop_options
 
+static bool f16c_is_supported(void)
+{
+	unsigned max = __get_cpuid_max(0, NULL);
+	unsigned eax, ebx, ecx, edx;
+
+	if (max >= 1) {
+		__cpuid(1, eax, ebx, ecx, edx);
+
+		if (ecx & bit_F16C)
+			return true;
+	}
+	return false;
+}
+
 static void float_to_half(const float *f, uint16_t *h, unsigned int num)
 {
 	for (int i = 0; i < num; i++)
@@ -194,9 +210,10 @@ static void half_to_float(const uint16_t *h, float *f, unsigned int num)
 		f[i] = _half_to_float(h[i]);
 }
 
+
 static void (*resolve_float_to_half(void))(const float *f, uint16_t *h, unsigned int num)
 {
-	if (igt_x86_features() & F16C)
+	if (f16c_is_supported())
 		return float_to_half_f16c;
 
 	return float_to_half;
@@ -207,7 +224,7 @@ void igt_float_to_half(const float *f, uint16_t *h, unsigned int num)
 
 static void (*resolve_half_to_float(void))(const uint16_t *h, float *f, unsigned int num)
 {
-	if (igt_x86_features() & F16C)
+	if (f16c_is_supported())
 		return half_to_float_f16c;
 
 	return half_to_float;
-- 
2.23.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-09-30 10:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-30  9:06 [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function brandon.hong
2019-09-30  9:16 ` [igt-dev] ✗ GitLab.Pipeline: warning for Fix global symbol loading failure in resolve function (rev3) Patchwork
2019-09-30  9:32 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2019-09-30 10:38 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2019-09-30  9:30 [igt-dev] [PATCH i-g-t] Fix global symbol loading failure in resolve function brandon.hong
2019-09-24 14:02 brandon.hong
2019-09-27 17:26 ` Ville Syrjälä
2019-09-30  9:04   ` Hong, Brandon
2019-09-24  8:02 brandon.hong
2019-09-24  8:26 ` Chris Wilson
2019-09-24 14:22   ` Hong, Brandon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.