From patchwork Wed Mar 2 14:00:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 8480771 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9E691C0553 for ; Wed, 2 Mar 2016 14:01:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C1B1C20386 for ; Wed, 2 Mar 2016 14:01:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 025DC2038E for ; Wed, 2 Mar 2016 14:01:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2129B6E87D; Wed, 2 Mar 2016 14:01:16 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id D5EB26E877 for ; Wed, 2 Mar 2016 14:01:09 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id l68so9784145wml.3 for ; Wed, 02 Mar 2016 06:01:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=yPdWajM3yiVXjLvAoL6L/0U5Uq3MTbtojfoG+AR+yzg=; b=s06jxZWxBfJdGXx0UOb7fIHMqcBBnhfhIFEKOYKBC9DbUgmeu6s0gf6EN6SSOqSV0c EzOoa7ujaAUW4Zdj9PndXqYhci7OV8OFJWOJnt8N55KNOWjdug3u+5thaz6hRcEWDrMm vsKmlR3OF+tOxmQK8MbWinqrxHhYsVmJetxSnbHVwlylAod6n2PBQE9ho2DgmyO6rVN/ 1E8ktHy/ddl9kQfIICmzYN+RnfEyOu0mBjiv96bnk0rtMEbwKob/1acVcKEcTYYjq5DB DDly3xfIOc6S6XqAQy+dLeowcOuYuJbc26i83mBT2wlwhX/z8inV4e3uX1puPp2p9A7m GzEQ== 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 :in-reply-to:references; bh=yPdWajM3yiVXjLvAoL6L/0U5Uq3MTbtojfoG+AR+yzg=; b=EMrtnDZgjqRpjEJ5NE5Fa/mPbxviL1YHcWZUhJ5pkXVRIobfTtC6hGNnpKD988watC WerjGK9xHJ9ZqRvAP5qhxDz1T7mxEmZM+A+7rdKRSTzTaokjI3wUK+Nt7pNV68e4VJz0 gPwq0f8EszI2icAzZjflvdSF5ia7+F0KmPKLNxkvnJzTb5Wb4Wd6Elcw9lXBY6hRI9hy DGITGbX6cYtGPClJgNUVdYJNb4lpxOKarxSdoUmmhMKSkHR2U9M4jCtO5c2hodYXR6a+ kvhFLL0d2cozbIb6zngVDb/PW5vQxmlnYkXbAzDBfto6aAJdBHhoAwrI2FEHVsKcrEGj Ngdw== X-Gm-Message-State: AD7BkJLbA2rqLIXWSl2oFiN1jSXk/0V8lbcDBz3pcuMmoqtSQ7A+JVb+Sn8JlnQwZkEefg== X-Received: by 10.28.170.137 with SMTP id t131mr81576wme.32.1456927268202; Wed, 02 Mar 2016 06:01:08 -0800 (PST) Received: from cizrna.lan ([109.72.12.223]) by smtp.gmail.com with ESMTPSA id e19sm4359876wmd.1.2016.03.02.06.01.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Mar 2016 06:01:07 -0800 (PST) From: Tomeu Vizoso To: Intel GFX discussion Date: Wed, 2 Mar 2016 15:00:12 +0100 Message-Id: <1456927221-32421-6-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456927221-32421-1-git-send-email-tomeu.vizoso@collabora.com> References: <1456927221-32421-1-git-send-email-tomeu.vizoso@collabora.com> Cc: Daniel Stone , Tomeu Vizoso , Micah Fedke , Gustavo Padovan , Emil Velikov Subject: [Intel-gfx] [i-g-t PATCH v1 05/14] lib: Call intel_get_drm_devid only from intel code 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-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It only makes sense when testing the i915 driver, so don't call it otherwise. Signed-off-by: Tomeu Vizoso --- lib/igt_fb.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/igt_fb.c b/lib/igt_fb.c index 5f23136e01ac..3e76a419b3ee 100644 --- a/lib/igt_fb.c +++ b/lib/igt_fb.c @@ -76,15 +76,14 @@ static struct format_desc_struct { static void igt_get_fb_tile_size(int fd, uint64_t tiling, int fb_bpp, unsigned *width_ret, unsigned *height_ret) { - uint32_t devid = intel_get_drm_devid(fd); - switch (tiling) { case LOCAL_DRM_FORMAT_MOD_NONE: *width_ret = 64; *height_ret = 1; break; case LOCAL_I915_FORMAT_MOD_X_TILED: - if (intel_gen(devid) == 2) { + if (is_i915_device(fd) && + intel_gen(intel_get_drm_devid(fd)) == 2) { *width_ret = 128; *height_ret = 16; } else { @@ -93,7 +92,8 @@ static void igt_get_fb_tile_size(int fd, uint64_t tiling, int fb_bpp, } break; case LOCAL_I915_FORMAT_MOD_Y_TILED: - if (IS_915(devid)) + if (is_i915_device(fd) && + IS_915(intel_get_drm_devid(fd))) *width_ret = 512; else *width_ret = 128; @@ -145,8 +145,9 @@ void igt_calc_fb_size(int fd, int width, int height, int bpp, uint64_t tiling, igt_get_fb_tile_size(fd, tiling, bpp, &tile_width, &tile_height); - if (intel_gen(intel_get_drm_devid(fd)) <= 3 && - tiling != LOCAL_DRM_FORMAT_MOD_NONE) { + if (is_i915_device(fd) && + tiling != LOCAL_DRM_FORMAT_MOD_NONE && + intel_gen(intel_get_drm_devid(fd)) <= 3) { int v; /* Round the tiling up to the next power-of-two and the region