From patchwork Tue Jun 7 08:20:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 9160113 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0DE8D6086D for ; Tue, 7 Jun 2016 08:20:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A105281FE for ; Tue, 7 Jun 2016 08:20:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E33E2834F; Tue, 7 Jun 2016 08:20:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6598281FE for ; Tue, 7 Jun 2016 08:20:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D4D316E6CA; Tue, 7 Jun 2016 08:20:37 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 290A46E6CA for ; Tue, 7 Jun 2016 08:20:35 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id r5so3888478wmr.0 for ; Tue, 07 Jun 2016 01:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=/bXNHHCXezxl7O0Kia4PPRfPNSCC/w6qK60VhuuXEzw=; b=xHQ7PpPTdr5T3nuH5xxOzCr9nT+vvO1sWYnvNbno/B/wSpO3G+jkt6qfTeLlsAzP3L 2C34LbOVQr2y3IguJK+px2oiQuZBML4iES1hodjIMgLWMzqQNN/x5OwObA9dh6ArJIeB SgFJJsbgHgvBwrMmVmt1ONimZMOn4El9c2Lu26HHrRqavx/HlnR520q9hq6y97jcEoj8 qWdr0ZslF6Ce2AbnMh99ieAuhk3dwErPPYbljt9nXj5dm5s8lDmsVX8oONukKoOcHsgQ Dj7+EgZ3eOT9xUlOWeXWw76NOSMwByoDticdt9sZhSOdW2bmg05IMIbuD1hIKrIJ7Ies Sgug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=/bXNHHCXezxl7O0Kia4PPRfPNSCC/w6qK60VhuuXEzw=; b=UNJQi7XU8D9h0g0daaPyWCKy1StCq4YKmLyxKSM1seQw6wOVZWJAHdsXTFgHra1P6x 5x7k1nEacuRfTiOheMAhU2Hnke2EjsJfNVfIiO0k6ZIkbMk1Poou+UqbaYXNmSr8RJgF XkG+HJWR7Drt7MBGUTxsoQhDDId3MDAymzS0Sw6Mb9b0HLWOp9sg4n4Oz4QVLYEfR36N SghCQ01ABBGw1BMpSN4UJrgouAmDflF2AMRmx5bBCpLcf0WH9Yvka85UUhqi3oDbTiFT IJh6X3ZSHEB7IV6VcIx+4/lvUbqD/rmMpwLdnXogSKc5Kr15TQh2eE+pYh/QXXbxK5sI r3Xg== X-Gm-Message-State: ALyK8tIbEZihpt3QMDksNxCYtK2P1XOSQUTxMscseO2mgeIG9TgNCJ9uLfPnYBIG1QpaaA== X-Received: by 10.194.104.138 with SMTP id ge10mr18291495wjb.85.1465287633401; Tue, 07 Jun 2016 01:20:33 -0700 (PDT) Received: from cizrna.lan ([109.72.12.27]) by smtp.gmail.com with ESMTPSA id y1sm24178179wjl.31.2016.06.07.01.20.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jun 2016 01:20:32 -0700 (PDT) From: Tomeu Vizoso To: Intel GFX discussion Date: Tue, 7 Jun 2016 10:20:06 +0200 Message-Id: <1465287606-16648-1-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.5.5 Cc: Tomeu Vizoso Subject: [Intel-gfx] [PATCH i-g-t] igt/kms_cursor_legacy: wrap __builtin_ia32_pause inside cpu_relax X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP So that we can add an alternative implementation for the other arches. This is basically what the kernel does. Signed-off-by: Tomeu Vizoso --- tests/kms_cursor_legacy.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c index 5cb26d1c25e5..8c2d726f9d15 100644 --- a/tests/kms_cursor_legacy.c +++ b/tests/kms_cursor_legacy.c @@ -28,6 +28,12 @@ #include "igt.h" #include "igt_stats.h" +#if defined(__x86_64__) || defined(__i386__) +#define cpu_relax() __builtin_ia32_pause() +#else +#define cpu_relax() asm volatile("": : :"memory") +#endif + IGT_TEST_DESCRIPTION("Stress legacy cursor ioctl"); struct data { @@ -111,7 +117,7 @@ static void stress(struct data *data, sched_setaffinity(getpid(), sizeof(cpu_set_t), &allowed); igt_until_timeout(timeout) { count++; - __builtin_ia32_pause(); + cpu_relax(); } igt_debug("[hog:%d] count=%llu\n", child, count); }