From patchwork Thu Jun 30 21:29:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9208977 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 D831E6075A for ; Thu, 30 Jun 2016 21:30:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C991A28682 for ; Thu, 30 Jun 2016 21:30:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCCDD2868C; Thu, 30 Jun 2016 21:30:01 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 656AD28682 for ; Thu, 30 Jun 2016 21:30:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AD5046E909; Thu, 30 Jun 2016 21:29:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-f196.google.com (mail-qk0-f196.google.com [209.85.220.196]) by gabe.freedesktop.org (Postfix) with ESMTPS id 504336E909 for ; Thu, 30 Jun 2016 21:29:57 +0000 (UTC) Received: by mail-qk0-f196.google.com with SMTP id r68so16864493qka.3 for ; Thu, 30 Jun 2016 14:29:57 -0700 (PDT) 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=BEy9NfTm52tPR7f5IQ6jEb+Os+uEjYdp0+8AZ82nvq/h4sTZ6k2Zewle21pOGCz6+z GstGP5+XX2+mxpBeD/r/xXk8+Y4IcBzzqtoBm2yKlPLtAx+KP+WxBU0TpDYpU5otNaZe 5IERTBam3bpLbpctEiRpgXW8Ij8IAnUjwSN3faz9H5/QpvGDI/NG5/h2s8hG9AYUo0om cCNZaXqA6qr2kwVZIFO8y0tN1KkChTRVM7Xh0ygqT42O07xXc79dnWl2TvRYIrRmB7M8 Jupivhb1swULuhxWHf3hIHdzppuk2E39fmDJr55XI3HHNIjp6aD9xpTA2LqpFQcNtqi1 hOhg== X-Gm-Message-State: ALyK8tIvfdCGIWfAzd80LANEg9F4UDdDoqZ0S3s0ZAi1h2LzdOGxP7bJ5DizK8WtX7X+Qw== X-Received: by 10.129.166.80 with SMTP id d77mr8001608ywh.197.1467322195508; Thu, 30 Jun 2016 14:29:55 -0700 (PDT) Received: from jade.localdomain ([189.61.225.79]) by smtp.gmail.com with ESMTPSA id r8sm5072946ywb.20.2016.06.30.14.29.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jun 2016 14:29:54 -0700 (PDT) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [PATCH i-g-t 2/2] lib/drmtest: add virtio_gpu support Date: Thu, 30 Jun 2016 18:29:47 -0300 Message-Id: <1467322187-31530-2-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1467322187-31530-1-git-send-email-gustavo@padovan.org> References: <1467322187-31530-1-git-send-email-gustavo@padovan.org> Cc: Gustavo Padovan X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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