From patchwork Thu Sep 17 00:08:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11781195 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 515E4139A for ; Thu, 17 Sep 2020 00:09:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2A7DA2220D for ; Thu, 17 Sep 2020 00:09:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ad0L/48W" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A7DA2220D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E6D7D6EB58; Thu, 17 Sep 2020 00:09:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by gabe.freedesktop.org (Postfix) with ESMTPS id B23DE6EB55 for ; Thu, 17 Sep 2020 00:09:00 +0000 (UTC) Received: by mail-pj1-x1041.google.com with SMTP id v14so291747pjd.4 for ; Wed, 16 Sep 2020 17:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=N6EdaR9KwU+pnvkycYJPPLNu+q7R7PLRGVA6ARzb1Q8=; b=ad0L/48WkaNbOn0F+C5TRLP/wcVC9f9p4MGUwWRYSFGsLnGRAfl/TXgRgQf7ZCzuHH fkjBYtBkKQDdFezCRpsQj6Ned986bp7cfEUX+opTUM9usJcaa3gfCf1Sri2DSdtncKAH 8zJnvXS/IMQvhCN9L5wExo1L+7zlGuMOt8QB0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=N6EdaR9KwU+pnvkycYJPPLNu+q7R7PLRGVA6ARzb1Q8=; b=uYxZY5P/CCpX+h+cjU3XSuxaxWRR24FVbsNBYP1o340wKFuNozI+8Edr8oYHJTqBDu hNJEVQaDUHDYO8J6nNr5/BsVcW20eA3a+wzEFxNeseDhZ2zpu1ff2f9pwMSgR0iuHydU HY2v4VtS8Wia2oMYXrpFbDFNur1axLyX2hCk0asAB42QMIhlm2W6xJb0uztW1OrX5lBb kTQ9aUVqGu96KdIyywcIt79DPG5nINMwJhSrtucDeSPgnSCPBxNcH3OeAFjhmVOW1vsK SAqvo+RQGw43mdXlalCp+9sMshXdTHqiOz37UQvMzy50NUTIk4G4y3tcnQEFUir7gUw3 z19g== X-Gm-Message-State: AOAM533ZOBQNy5PxSNfQo1MlvagSAiTLcKJEM0Wj0q1yOKkKScW3/EAs PJLXxrcmdxVVyK/CkvrIoyqbgiob6gtVAg== X-Google-Smtp-Source: ABdhPJyZABlysGcbAiXGH+8bJYzNYODaHwPxcmLVTy/2iY8CZqyqw2bslDNwxzehZt49U4dZIj4xTA== X-Received: by 2002:a17:90a:fb52:: with SMTP id iq18mr6195465pjb.162.1600301340050; Wed, 16 Sep 2020 17:09:00 -0700 (PDT) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:5265:f3ff:fe2d:4d58]) by smtp.gmail.com with ESMTPSA id o19sm13737917pfp.64.2020.09.16.17.08.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 17:08:59 -0700 (PDT) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 19/19] drm/virtio: advertise features to userspace Date: Wed, 16 Sep 2020 17:08:38 -0700 Message-Id: <20200917000838.735-19-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200917000838.735-1-gurchetansingh@chromium.org> References: <20200917000838.735-1-gurchetansingh@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kraxel@redhat.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" New api changes are now available to userspace. Also, the comparison to true is redundant, so remove it. Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index 3ede098c1d280..5417f365d1a39 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -212,11 +212,20 @@ static int virtio_gpu_getparam_ioctl(struct drm_device *dev, void *data, switch (param->param) { case VIRTGPU_PARAM_3D_FEATURES: - value = vgdev->has_virgl_3d == true ? 1 : 0; + value = vgdev->has_virgl_3d ? 1 : 0; break; case VIRTGPU_PARAM_CAPSET_QUERY_FIX: value = 1; break; + case VIRTGPU_PARAM_RESOURCE_BLOB: + value = vgdev->has_resource_blob ? 1 : 0; + break; + case VIRTGPU_PARAM_HOST_VISIBLE: + value = vgdev->has_host_visible ? 1 : 0; + break; + case VIRTGPU_PARAM_CROSS_DEVICE: + value = vgdev->has_resource_assign_uuid ? 1 : 0; + break; default: return -EINVAL; }