From patchwork Mon Nov 14 09:59:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9426953 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 E84B660471 for ; Mon, 14 Nov 2016 09:59:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE2E0286D4 for ; Mon, 14 Nov 2016 09:59:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D35A1286E5; Mon, 14 Nov 2016 09:59:57 +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=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A9F9F286D4 for ; Mon, 14 Nov 2016 09:59:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 532EB6E39B; Mon, 14 Nov 2016 09:59:50 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4F9246E397; Mon, 14 Nov 2016 09:59:43 +0000 (UTC) Received: by mail-pf0-f196.google.com with SMTP id y68so5966498pfb.1; Mon, 14 Nov 2016 01:59:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PYfUQQUaEB3k7IM0OSc323XPOk4JkQrOHcRLZaS2UdU=; b=f84GQuSrnAFNbgUXUuoPcfZeZ9tPZta7+4f8yvAYACKCJfb4pVNJkFtppjPn6FnLzq QqPXpsQhYSB0IUjXaUuQzsaHTfMsc9owt6nH/Df5iOdTALnOT+UhSr/wASQWMnl4PtKo /+o4whPCo+9XAsM/KxwqY7ecA+p6bjv6Slyf4Jm/3s1MoXVVnEqkjFXDtS3BQrZf1h8Y SoXyilYzIoPuQZCTfT//36fj6Wx+3tCRr476w7cerxTN/jgKM6qzicUwP/k5P0c2w1NW yV/AI4BKkrP3WiGjSFJ5UoCalC+QvFru9LzA8/74PgLy/tnrI/3ng0QRc04KDbddhW7P OYgQ== X-Gm-Message-State: ABUngvf2QKEnirqFTVTP3VhFKwaE/a/ce/EsOmbg6FHLZUgzsEvgATvTKjMcJJU1OZ7W8Q== X-Received: by 10.99.178.89 with SMTP id t25mr67153261pgo.131.1479117582723; Mon, 14 Nov 2016 01:59:42 -0800 (PST) Received: from jade.nodan1.kt.home.ne.jp (202-72-64-164.koalanet.ne.jp. [202.72.64.164]) by smtp.gmail.com with ESMTPSA id p125sm14320235pfg.33.2016.11.14.01.59.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Nov 2016 01:59:42 -0800 (PST) From: Gustavo Padovan To: intel-gfx@lists.freedesktop.org Date: Mon, 14 Nov 2016 18:59:15 +0900 Message-Id: <1479117566-17709-4-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1479117566-17709-1-git-send-email-gustavo@padovan.org> References: <1479117566-17709-1-git-send-email-gustavo@padovan.org> Cc: Gustavo Padovan , dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH i-g-t 2/2] lib/drmtest: add virtio_gpu support 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 From: Gustavo Padovan Support the virtio GPU on drmtest. Signed-off-by: Gustavo Padovan --- lib/drmtest.c | 9 +++++++++ lib/drmtest.h | 1 + 2 files changed, 10 insertions(+) diff --git a/lib/drmtest.c b/lib/drmtest.c index 9f3ac7f..b374006 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -115,6 +115,11 @@ static bool is_vgem_device(int fd) return __is_device(fd, "vgem"); } +static bool is_virtio_device(int fd) +{ + return __is_device(fd, "virt"); +} + static bool has_known_intel_chipset(int fd) { struct drm_i915_getparam gp; @@ -260,6 +265,10 @@ int __drm_open_driver(int chipset) is_vgem_device(fd)) return fd; + if (chipset & DRIVER_VIRTIO && + is_virtio_device(fd)) + return fd; + close(fd); } diff --git a/lib/drmtest.h b/lib/drmtest.h index 8ce32a6..19d4bd1 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -41,6 +41,7 @@ #define DRIVER_INTEL (1 << 0) #define DRIVER_VC4 (1 << 1) #define DRIVER_VGEM (1 << 2) +#define DRIVER_VIRTIO (1 << 3) #define DRIVER_ANY ~(DRIVER_VGEM) #ifdef ANDROID