From patchwork Thu Mar 15 14:45:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Hecht X-Patchwork-Id: 10284637 X-Patchwork-Delegate: geert@linux-m68k.org 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 61C6260386 for ; Thu, 15 Mar 2018 14:46:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5609628AED for ; Thu, 15 Mar 2018 14:46:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AE4628AF0; Thu, 15 Mar 2018 14:46:25 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2BC328AED for ; Thu, 15 Mar 2018 14:46:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932279AbeCOOqX (ORCPT ); Thu, 15 Mar 2018 10:46:23 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:34061 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752413AbeCOOqJ (ORCPT ); Thu, 15 Mar 2018 10:46:09 -0400 Received: by mail-wr0-f193.google.com with SMTP id o8so8623555wra.1 for ; Thu, 15 Mar 2018 07:46:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Bgh3sK7uvXTH7/o8IrwlfC1ZYWhR57AmzaAdB14X/Ks=; b=MGIAg1Eq6N8cdAR7KzjZw9/sR1d3HEtNALDGkvUa/RxSry8RLR1fEU1bRx0f25cMKL BKbBkz9/vNFWy/35odqMixqwGEI/ggh4FmuyUQQpA7cYsomLlGfqJeCkrr2DzWvJ4dFX yoehcZp9NsQ0qXLCSj90Ye0gYMnffIbn1jgtDWPie1SLnscPN6IeRhLzxkCgIobHNIf0 LEaIfcTkOEY57TcyuXND8IdWzgATnXAz1WPInxzP9rekMQgsfKzx7VuKXKXqzBFnU4RQ boZYwJJ/8H1cysaT9AgT7Y3sA1MJxWxqIkYTdVG6by06GJCE8cSQHlI9BBLlzMvQ50/2 l4Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Bgh3sK7uvXTH7/o8IrwlfC1ZYWhR57AmzaAdB14X/Ks=; b=QJ3tiAyOued57GDuZO5T/Eupwyi+j98W31kjU4RivdirDQfsxp4Df6mWwWMmcmmhGS XAWEKyXXb6LxOthpC7Do9lI+bg+71jfBkNa/I04fKsJdtStLwRUK6LfxVL1D1A7i+GYS 1UvQEhgL4C3DT8SYPCa3Sn191QzkG/WHDdU0KONPWuCRgBcYoyJ5wPr6pCtGiMhxhjBH 3b+JBTmivJcwbx5u6397EpNOTOxQrcKipYl6aANSNkXlTgoRxZemMQ0pc5Kd5s35xNRc fzAfBgFrYA8BsnyZ4QqMix3xPlMyGeZxBKYKTRLuXWztI/TQYfp1fWt11TdWEuv8ihsj 1XtA== X-Gm-Message-State: AElRT7HdF4U/OUM/Mi/tFbADAmmbiUJmu0O6sqF1cefQxDCj9A7D5jnC RXfr4BUGCqvCYPeSiU/7Yg== X-Google-Smtp-Source: AG47ELtwuqy7iQYyHw+b6vZIIlfWe/qbHkFLNTVYNJ1/7rjVWcC+LzqZdlj+tZer1DsWIe1cPWAlbA== X-Received: by 10.223.171.247 with SMTP id s110mr7538683wrc.106.1521125168145; Thu, 15 Mar 2018 07:46:08 -0700 (PDT) Received: from groucho.site (ipbcc0ce2f.dynamic.kabel-deutschland.de. [188.192.206.47]) by smtp.gmail.com with ESMTPSA id m71sm4340486wmd.6.2018.03.15.07.46.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Mar 2018 07:46:07 -0700 (PDT) From: Ulrich Hecht To: intel-gfx@lists.freedesktop.org Cc: linux-renesas-soc@vger.kernel.org, laurent.pinchart@ideasonboard.com, Ulrich Hecht Subject: [PATCH igt 3/8] lib/igt_gt: has_gpu_reset(): fix failed assertion on non-i915 platforms Date: Thu, 15 Mar 2018 15:45:39 +0100 Message-Id: <1521125144-28614-4-git-send-email-ulrich.hecht+renesas@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521125144-28614-1-git-send-email-ulrich.hecht+renesas@gmail.com> References: <1521125144-28614-1-git-send-email-ulrich.hecht+renesas@gmail.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Checks if we have an i915 device before using intel_get_drm_devid(). Signed-off-by: Ulrich Hecht --- lib/igt_gt.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/igt_gt.c b/lib/igt_gt.c index e630550..9cb07c2 100644 --- a/lib/igt_gt.c +++ b/lib/igt_gt.c @@ -59,14 +59,17 @@ static bool has_gpu_reset(int fd) struct drm_i915_getparam gp; int val = 0; - memset(&gp, 0, sizeof(gp)); - gp.param = 35; /* HAS_GPU_RESET */ - gp.value = &val; - - if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp)) - once = intel_gen(intel_get_drm_devid(fd)) >= 5; - else - once = val > 0; + if (is_i915_device(fd)) { + memset(&gp, 0, sizeof(gp)); + gp.param = 35; /* HAS_GPU_RESET */ + gp.value = &val; + + if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp)) + once = intel_gen(intel_get_drm_devid(fd)) >= 5; + else + once = val > 0; + } else + once = 0; } return once; }