From patchwork Wed Dec 18 00:59:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11299225 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 7284713B6 for ; Wed, 18 Dec 2019 00:59:51 +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 502C6206D3 for ; Wed, 18 Dec 2019 00:59:51 +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="LUgh4d7Z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 502C6206D3 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 4F69C6E1F9; Wed, 18 Dec 2019 00:59:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by gabe.freedesktop.org (Postfix) with ESMTPS id BD2106E1F9 for ; Wed, 18 Dec 2019 00:59:45 +0000 (UTC) Received: by mail-pj1-x102d.google.com with SMTP id r67so62267pjb.0 for ; Tue, 17 Dec 2019 16:59:45 -0800 (PST) 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=j7qS+TQOqmuSYyY7pRPONbFeLo/ktg1P/BEGbNAEe3Q=; b=LUgh4d7ZpweDaTprsJm4AVAAfmTtNxkkVgToEPeM+8rrCDjtGuZcCKSHLH1bKE1yPD sHXidzK7qYSMSOmq8g7VgvI4shQSv65sYQII6pJSfVv6Og5RzYLaoS1K/5lWT7gYYCE5 XN3OVzNCkpJYAZ/QrVva9JqmY7+Zqv72eIRAY= 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=j7qS+TQOqmuSYyY7pRPONbFeLo/ktg1P/BEGbNAEe3Q=; b=MGG5gRHSFEe+15rGjbXzMWCK/kLKQDx3nPAtUJ/mhlfxv+c0Vnpxp04ldoN4jBrQ6O gKjLbys3eDixtspNfGuxGgt9b//JwOh23hrDUT6+Lotft84td0INciqnWPGUZEwtT7BC W2q9J7x7s8nCxjEKlDpi+e7qYL4eJX9DDMtgTAd9pUM8NIkYNE150+zSU2tF1CNZGt4H YacWIUwxs1YBjfNmLYgswx45wFS+yMyjMwPbYBUxfF2xS5LMLWZI8XQPQLbCq0wpPSd9 knc1HiEjEAxNLJtYHKlHpqKepK1nSB2aFLqTzBn8bfQPqFGrOPzV8fVYbnCvPv7UclQU ldrA== X-Gm-Message-State: APjAAAXbdOxHLb8NYIGyi2gQ+4tk7XmwESklVNRoDx6/opNqKhbWVy+/ wWbuqHpyO4bbB/GQb+KMOnqjDzWGQcc= X-Google-Smtp-Source: APXvYqz9kJYeo4KrcKz9Fu/LFvcXe1/9Fiincmzi6CdJCH6mEK/uf+vtT1Ts3FAHyPkor3P3NfozHg== X-Received: by 2002:a17:902:d883:: with SMTP id b3mr1020106plz.231.1576630785150; Tue, 17 Dec 2019 16:59:45 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:bc97:5740:52a7:6875]) by smtp.gmail.com with ESMTPSA id r1sm240802pgp.15.2019.12.17.16.59.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Dec 2019 16:59:44 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/9] drm/virtio: static-ify virtio_fence_signaled Date: Tue, 17 Dec 2019 16:59:21 -0800 Message-Id: <20191218005929.6709-2-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191218005929.6709-1-gurchetansingh@chromium.org> References: <20191218005929.6709-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: Gurchetan Singh , kraxel@redhat.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Not used anywhere else. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 - drivers/gpu/drm/virtio/virtgpu_fence.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index eedae2a7b532..6b3f1551a2f1 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -350,7 +350,6 @@ struct drm_plane *virtio_gpu_plane_init(struct virtio_gpu_device *vgdev, int index); /* virtio_gpu_fence.c */ -bool virtio_fence_signaled(struct dma_fence *f); struct virtio_gpu_fence *virtio_gpu_fence_alloc( struct virtio_gpu_device *vgdev); void virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev, diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c b/drivers/gpu/drm/virtio/virtgpu_fence.c index a4b9881ca1d3..5466aab7d39a 100644 --- a/drivers/gpu/drm/virtio/virtgpu_fence.c +++ b/drivers/gpu/drm/virtio/virtgpu_fence.c @@ -37,7 +37,7 @@ static const char *virtio_get_timeline_name(struct dma_fence *f) return "controlq"; } -bool virtio_fence_signaled(struct dma_fence *f) +static bool virtio_fence_signaled(struct dma_fence *f) { struct virtio_gpu_fence *fence = to_virtio_fence(f); From patchwork Wed Dec 18 00:59:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11299227 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 C959D6C1 for ; Wed, 18 Dec 2019 00:59:53 +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 A7482206D3 for ; Wed, 18 Dec 2019 00:59:53 +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="GRwte4Oz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A7482206D3 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 3E13A6E1FB; Wed, 18 Dec 2019 00:59:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7A9AF6E1FB for ; Wed, 18 Dec 2019 00:59:47 +0000 (UTC) Received: by mail-pl1-x641.google.com with SMTP id y8so163508pll.13 for ; Tue, 17 Dec 2019 16:59:47 -0800 (PST) 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=TBFjUWm46buk8vUV/NxlMxl8UOi4x3APdXMTOIFgTM8=; b=GRwte4OzKZi/whsg2HodWLfiXlJcX7CuoTATGWP6mM36XzAgZEtjnU3oMef2m6T5U3 5t2z2+d2uC5teSVaYHCZ3qhlVklm8yj8yaQ8MZAony2ApuEVu6RhC3Wm1kHfoX+z3WFy YQiX2QHGmQCFBJu8/JIm6WJNba8zrNxPFcwMA= 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=TBFjUWm46buk8vUV/NxlMxl8UOi4x3APdXMTOIFgTM8=; b=eu84FJFvIIg3TEUeWzVngzJxhnxHnFzByLV7wJlJDfch9LeNpI9kNz8RoBnTnI9Jqv OX/mp1IMnlY7/aH+h/VmNptHowSPFowzqmNqJJqFb7O2aG0Wl9L8eGNPcT5okqc1XQA/ 4M/kMuZlunBwzP/tEulJTkN+gPxh9MAKOVljQqydIPmpMjqfkN6Q9n+hgyqozSlqtRmT a7RuS3Q+XSSeuYE56rYI1vwk4oJQLifMLdUX2OIQSlbI4GV0f+sAesfgcKSDfZ9cr8FF y4uNXbjgiQKROHot72JfD+tmsJ1izFd+RoIDD8kP8EZ0v9hiusBK6/XEkx2M7lbpBREJ p4eQ== X-Gm-Message-State: APjAAAXC7ETbdrNRoNW+7xPZcLyNSjGkhx9om4zFujHkwYwEKxLYf6xv YtYZTS0S1EWHC9oZFMFqHLQ7sNvaK0g= X-Google-Smtp-Source: APXvYqydfV7sfBmnSS2yRGJ+GfGrmkF6S4TIBB3ssFmgQLpj8zIwTtJodWmpNGzMDrbKxMaZKxFhBA== X-Received: by 2002:a17:90a:c593:: with SMTP id l19mr255774pjt.110.1576630786883; Tue, 17 Dec 2019 16:59:46 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:bc97:5740:52a7:6875]) by smtp.gmail.com with ESMTPSA id r1sm240802pgp.15.2019.12.17.16.59.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Dec 2019 16:59:46 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/9] drm/virtio: static-ify virtio_gpu_framebuffer_init Date: Tue, 17 Dec 2019 16:59:22 -0800 Message-Id: <20191218005929.6709-3-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191218005929.6709-1-gurchetansingh@chromium.org> References: <20191218005929.6709-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: Gurchetan Singh , kraxel@redhat.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Not used anywhere else. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/virtio/virtgpu_display.c | 2 +- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index e622485ae826..c76d69fecfeb 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -59,7 +59,7 @@ static const struct drm_framebuffer_funcs virtio_gpu_fb_funcs = { .dirty = drm_atomic_helper_dirtyfb, }; -int +static int virtio_gpu_framebuffer_init(struct drm_device *dev, struct virtio_gpu_framebuffer *vgfb, const struct drm_mode_fb_cmd2 *mode_cmd, diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index 6b3f1551a2f1..b2270153528c 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -336,10 +336,6 @@ void virtio_gpu_dequeue_cursor_func(struct work_struct *work); void virtio_gpu_dequeue_fence_func(struct work_struct *work); /* virtio_gpu_display.c */ -int virtio_gpu_framebuffer_init(struct drm_device *dev, - struct virtio_gpu_framebuffer *vgfb, - const struct drm_mode_fb_cmd2 *mode_cmd, - struct drm_gem_object *obj); void virtio_gpu_modeset_init(struct virtio_gpu_device *vgdev); void virtio_gpu_modeset_fini(struct virtio_gpu_device *vgdev); From patchwork Wed Dec 18 00:59:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11299229 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 2D1156C1 for ; Wed, 18 Dec 2019 00:59:56 +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 078BD206D3 for ; Wed, 18 Dec 2019 00:59:56 +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="TY3c8EMH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 078BD206D3 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 B95D66E201; Wed, 18 Dec 2019 00:59:52 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by gabe.freedesktop.org (Postfix) with ESMTPS id E696C6E1FB for ; Wed, 18 Dec 2019 00:59:48 +0000 (UTC) Received: by mail-pf1-x42b.google.com with SMTP id 4so208901pfz.9 for ; Tue, 17 Dec 2019 16:59:48 -0800 (PST) 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=U5G3vqL50Y3G4+e2Z9a/oR925neu1RDq2V1MgCTXG78=; b=TY3c8EMHIzub8LsQpF8QjRkf6a9scjkmtEvpRqc3aCUQ9n2zp4fEL9UmgURk8lF8u1 IhiDhw/9SaT06pmdto/O7a09poSCRVbPlruBcA4p884QoCKdjJlnMvKgV/LGwBVsB3jz L9PZeKlgbP/uFklpA4zPK3bi2vFc7WQxqqk4U= 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=U5G3vqL50Y3G4+e2Z9a/oR925neu1RDq2V1MgCTXG78=; b=geoErim35GBa81RSbbANwLYHq6kfn49gQT1ehaA6SjJMbruWAhtwIeOWSTxMQJgNMa Jsmf+tsHdwROFXmqwUsFuYEjtxQOjaOGvnPbFjB+MdkiDZtuKo1RuH41SQwUjJVP3LB/ AupF4vZIfUZvPgofxYdhAfTu9wIDDdX2X5en4TZ9N2ORTPOQfD8gJujbM2iQvImxg9BB Ct+tM+oO3sVpxUEzjpIIMvFApVSWYU15RB8mUdbnDemujMNkieg4oT+xZ99a8SnW+X2V jxPxwhmZXzgONgeEw04k7IqMflWVzyaXDkGzZqulhI5Ywi8gjmMQrtGOKBl8D3RRawmQ JJhw== X-Gm-Message-State: APjAAAXbGREWZRl0Ap9DrLhBxB2SNbhjelXfGLSLAyy5neE9xK38bM7+ hyT1I1jHroNeVJyrIeYD8x5UCtJLfGU= X-Google-Smtp-Source: APXvYqzf0pjVrGliirEIoA08ZDX7BT6UXayldWrnT3uH5Y9S+sUuKXO8T6gE8jiHqwn3qkyNQYOYXQ== X-Received: by 2002:a62:e915:: with SMTP id j21mr773908pfh.42.1576630788398; Tue, 17 Dec 2019 16:59:48 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:bc97:5740:52a7:6875]) by smtp.gmail.com with ESMTPSA id r1sm240802pgp.15.2019.12.17.16.59.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Dec 2019 16:59:47 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/9] drm/virtio: get rid of drm_encoder_to_virtio_gpu_output Date: Tue, 17 Dec 2019 16:59:23 -0800 Message-Id: <20191218005929.6709-4-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191218005929.6709-1-gurchetansingh@chromium.org> References: <20191218005929.6709-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: Gurchetan Singh , kraxel@redhat.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Not used anywhere. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index b2270153528c..45b4c3324b2c 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -137,8 +137,6 @@ struct virtio_gpu_output { container_of(x, struct virtio_gpu_output, crtc) #define drm_connector_to_virtio_gpu_output(x) \ container_of(x, struct virtio_gpu_output, conn) -#define drm_encoder_to_virtio_gpu_output(x) \ - container_of(x, struct virtio_gpu_output, enc) struct virtio_gpu_framebuffer { struct drm_framebuffer base; From patchwork Wed Dec 18 00:59:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11299231 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 0975813B6 for ; Wed, 18 Dec 2019 00:59:58 +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 DBA6B206D3 for ; Wed, 18 Dec 2019 00:59:57 +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="Q9JT07+s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBA6B206D3 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 86E436E203; Wed, 18 Dec 2019 00:59:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by gabe.freedesktop.org (Postfix) with ESMTPS id 777F86E200 for ; Wed, 18 Dec 2019 00:59:50 +0000 (UTC) Received: by mail-pl1-x643.google.com with SMTP id b22so165891pls.12 for ; Tue, 17 Dec 2019 16:59:50 -0800 (PST) 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=4bkB1dS3y6X/PqTypxd+ylxBnBVQ5JlWTazVWKmloP0=; b=Q9JT07+sN1NZaoGL/IAYw/004ugR1a1oICjY2mg53c+AFT4bNs1QouWCz8zRrwsBAB XNcLG65vqbW2F3ukiBi6upBRGfg3CAQiLEd5cC0kyW1OkFgYhe0rUR5i7FiBBXezl8z+ SstUtX/FNxUkF24MPEF7DZCQ7JHC2yRw3FGiU= 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=4bkB1dS3y6X/PqTypxd+ylxBnBVQ5JlWTazVWKmloP0=; b=XD7wtf4Sa4kACwujCJnVq0uVRkf6c2Skt7OtQnB2FALasAfTJcMjF0xwyEJcpEkzrx E+GZkubTekK4xV24wSDTNFM4MSka0Fd9YbcyOuLUprJoJeMwdK1O4Yyr5/t/8Lwd/aVM fCmZOd++hN+mDdrBlFcbVsfxQ/urUKg3AP1TiB3uvUBs72OZBY0ZIefciRCynKZk+glX SSGoxzpBDp++qQWmGgRTccrnGMwCGtDW4qcYj5criT0ya6fCgvT9scENtV89ht7XGhA0 XkNfsA+5WVTxQD4j3shb12w0/UkDM2Ukgs6bTJHNfpLOxGzLQHa2L4j2YzPeafne/SKE oC7Q== X-Gm-Message-State: APjAAAUrENyFXE+o9JTPWzcxJCxa7cArAsadR8sgBdMyRz+2jotFYUvg iq5lN5ufsOoe94JvSfpOEIdCOxs/hCY= X-Google-Smtp-Source: APXvYqzxHF42Q5meNE3oM1uvJib7eBm4sVcY7IponkYEJBA8LrstOYUdOfXjvpysvhYWvs5VIvzVKQ== X-Received: by 2002:a17:90a:33ad:: with SMTP id n42mr238161pjb.23.1576630789877; Tue, 17 Dec 2019 16:59:49 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:bc97:5740:52a7:6875]) by smtp.gmail.com with ESMTPSA id r1sm240802pgp.15.2019.12.17.16.59.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Dec 2019 16:59:49 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/9] drm/virtio: simplify getting fake offset Date: Tue, 17 Dec 2019 16:59:24 -0800 Message-Id: <20191218005929.6709-5-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191218005929.6709-1-gurchetansingh@chromium.org> References: <20191218005929.6709-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: Gurchetan Singh , kraxel@redhat.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is a little simpler. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/virtio/virtgpu_drv.h | 8 +------- drivers/gpu/drm/virtio/virtgpu_gem.c | 4 +--- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index 45b4c3324b2c..8dfb39f98552 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -359,18 +359,12 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev, struct virtio_gpu_object_params *params, struct virtio_gpu_object **bo_ptr, struct virtio_gpu_fence *fence); - /* virtgpu_prime.c */ struct drm_gem_object *virtgpu_gem_prime_import_sg_table( struct drm_device *dev, struct dma_buf_attachment *attach, struct sg_table *sgt); -static inline u64 virtio_gpu_object_mmap_offset(struct virtio_gpu_object *bo) -{ - return drm_vma_node_offset_addr(&bo->base.base.vma_node); -} - -/* virgl debufs */ +/* virgl debugfs */ int virtio_gpu_debugfs_init(struct drm_minor *minor); #endif diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c index 4c1f579edfb3..0a2b62279647 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -96,14 +96,12 @@ int virtio_gpu_mode_dumb_mmap(struct drm_file *file_priv, uint32_t handle, uint64_t *offset_p) { struct drm_gem_object *gobj; - struct virtio_gpu_object *obj; BUG_ON(!offset_p); gobj = drm_gem_object_lookup(file_priv, handle); if (gobj == NULL) return -ENOENT; - obj = gem_to_virtio_gpu_obj(gobj); - *offset_p = virtio_gpu_object_mmap_offset(obj); + *offset_p = drm_vma_node_offset_addr(&gobj->vma_node); drm_gem_object_put_unlocked(gobj); return 0; } From patchwork Wed Dec 18 00:59:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11299233 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 5648413B6 for ; Wed, 18 Dec 2019 01:00:01 +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 321682176D for ; Wed, 18 Dec 2019 01:00:01 +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="fQQYKOlu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 321682176D 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 758376E1F4; Wed, 18 Dec 2019 01:00:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 559016E202 for ; Wed, 18 Dec 2019 00:59:59 +0000 (UTC) Received: by mail-pf1-x441.google.com with SMTP id h14so206830pfe.10 for ; Tue, 17 Dec 2019 16:59:59 -0800 (PST) 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=yyyHW+YsY1PWq9tcDK5vwtSS9rTi8+t7ITEZCepACZA=; b=fQQYKOluVr3D7Hici4YaNYgM45AU851Z6qn0GoH4GAfT+yE1ZM7uEVRBDAMVsuGIB8 85Yq3ZMuuE9196lq2Bq1WehFqsSLprO1O6XDHhvbqSg1laQTAlt2THryEB4cM1sR8eJQ HFpkeqKLSC4aLU6xQWQDsW2AyjMRGqkcc3IfQ= 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=yyyHW+YsY1PWq9tcDK5vwtSS9rTi8+t7ITEZCepACZA=; b=FQ22gxY1EKyk+o79erIDRVbL/oIPFHDvl4al+IHPSzTtUQyAY0nmTE803pl891lxhC UKd5PPbozCZY4rIG7JspJEs95fSn5xre6KzWOqfASuV6Xbg7xm40cdaUn4ELVUSY8G1P YX9EWWcZIXULo/FIVRRWs1ShSEM8Ww4cs05JzjXWe/BJ8PCwRU5aIcYDrURu+KDAG8Ki UC0MosnHNIPO7IuPz3H5BkzbpaeI3B8PBxwluPPSCKraJmehhycGPOzW9L8so5WGDO2Z 0YiVDYb/XMjY7lmENaYm7B9bnbFmaP4f8IdaIX9Q7wsrTXFmrQylNK4PP5nI5FB11GK6 H+xQ== X-Gm-Message-State: APjAAAWwtHj8qPvIPsKAFLmfhR6DJOjjA2zrksN3JSAZ6IpxbzCPkHRN RP0xaBN2SIr5W/BD9pkIYPels3b96hQ= X-Google-Smtp-Source: APXvYqxmOdwSb9P2sFmqJ1hUzt2dtqEc+xQsWTPwGWeSvRmA53hKlOAmDc7McfAQgjT9nmcHhQtbOQ== X-Received: by 2002:a65:58c7:: with SMTP id e7mr330526pgu.390.1576630798607; Tue, 17 Dec 2019 16:59:58 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:bc97:5740:52a7:6875]) by smtp.gmail.com with ESMTPSA id r1sm240802pgp.15.2019.12.17.16.59.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Dec 2019 16:59:58 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 5/9] drm/virtio: remove virtgpu_gem_prime_import_sg_table Date: Tue, 17 Dec 2019 16:59:25 -0800 Message-Id: <20191218005929.6709-6-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191218005929.6709-1-gurchetansingh@chromium.org> References: <20191218005929.6709-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: Gurchetan Singh , kraxel@redhat.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Sharing memory between virtio devices is ill-defined, so until we have something let's get rid of this. drm_gem_prime_import_dev returns an error if the callback is NULL. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/virtio/Makefile | 2 +- drivers/gpu/drm/virtio/virtgpu_drv.c | 3 +- drivers/gpu/drm/virtio/virtgpu_drv.h | 5 ---- drivers/gpu/drm/virtio/virtgpu_prime.c | 38 -------------------------- 4 files changed, 2 insertions(+), 46 deletions(-) delete mode 100644 drivers/gpu/drm/virtio/virtgpu_prime.c diff --git a/drivers/gpu/drm/virtio/Makefile b/drivers/gpu/drm/virtio/Makefile index 92aa2b3d349d..36d8cf8e0cec 100644 --- a/drivers/gpu/drm/virtio/Makefile +++ b/drivers/gpu/drm/virtio/Makefile @@ -6,6 +6,6 @@ virtio-gpu-y := virtgpu_drv.o virtgpu_kms.o virtgpu_gem.o \ virtgpu_display.o virtgpu_vq.o \ virtgpu_fence.o virtgpu_object.o virtgpu_debugfs.o virtgpu_plane.o \ - virtgpu_ioctl.o virtgpu_prime.o virtgpu_trace_points.o + virtgpu_ioctl.o virtgpu_trace_points.o obj-$(CONFIG_DRM_VIRTIO_GPU) += virtio-gpu.o diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c index 8cf27af3ad53..e942465e4fb1 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.c +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c @@ -200,8 +200,7 @@ static struct drm_driver driver = { .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_prime_mmap = drm_gem_prime_mmap, - .gem_prime_import_sg_table = virtgpu_gem_prime_import_sg_table, - + .gem_prime_import_sg_table = NULL, .gem_create_object = virtio_gpu_create_object, .fops = &virtio_gpu_driver_fops, diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index 8dfb39f98552..77f446608ca9 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -359,11 +359,6 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev, struct virtio_gpu_object_params *params, struct virtio_gpu_object **bo_ptr, struct virtio_gpu_fence *fence); -/* virtgpu_prime.c */ -struct drm_gem_object *virtgpu_gem_prime_import_sg_table( - struct drm_device *dev, struct dma_buf_attachment *attach, - struct sg_table *sgt); - /* virgl debugfs */ int virtio_gpu_debugfs_init(struct drm_minor *minor); diff --git a/drivers/gpu/drm/virtio/virtgpu_prime.c b/drivers/gpu/drm/virtio/virtgpu_prime.c deleted file mode 100644 index 050d24c39a8f..000000000000 --- a/drivers/gpu/drm/virtio/virtgpu_prime.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2014 Canonical - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Authors: Andreas Pokorny - */ - -#include - -#include "virtgpu_drv.h" - -/* Empty Implementations as there should not be any other driver for a virtual - * device that might share buffers with virtgpu - */ - -struct drm_gem_object *virtgpu_gem_prime_import_sg_table( - struct drm_device *dev, struct dma_buf_attachment *attach, - struct sg_table *table) -{ - return ERR_PTR(-ENODEV); -} From patchwork Wed Dec 18 00:59:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11299235 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 B097A139A for ; Wed, 18 Dec 2019 01:00:05 +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 8D8512146E for ; Wed, 18 Dec 2019 01:00:05 +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="SrpMYNWU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D8512146E 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 7F92F6E202; Wed, 18 Dec 2019 01:00:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 51CCE6E204 for ; Wed, 18 Dec 2019 01:00:01 +0000 (UTC) Received: by mail-pg1-x544.google.com with SMTP id b9so253950pgk.12 for ; Tue, 17 Dec 2019 17:00:01 -0800 (PST) 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=V7MMnTK7WdH1cHIRULp8Rnd1QWMIByP2H3zvTLcqfB8=; b=SrpMYNWUCu8D6TFPTSl5VuzRKcZ0LUOrObIBpIslwlpZfeXXebfB/DceDmrAxV9o75 4bVGNUfbb+5AieYR45FYPq35+CJOFJqspphwkF9ok60nx1vCpVvpwY3ues6j6BVuBC0P 7FEIHWpfCFXl5BmKIjmxjLuQXYg/4wp/0Tz0s= 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=V7MMnTK7WdH1cHIRULp8Rnd1QWMIByP2H3zvTLcqfB8=; b=ORpLyj4wK9pwNFpMA+lUYbT9kFdMrDo9i8Gxl225kvkSZRfMdaKYW6XJGgvj++5+kB 4/XvZmgpKR05dFbwIYDXTZ+Op5MX49XO2YjMiFT3PXecEP+49sBe4UCIW0AGvMSSzlSf Qs6hPo1sq60vgqhFNx/X+O5EHF/UQJi6BlnJ/xF8hPuWPQ+wu22QKz+2sppbii003WrE sRu33x2zoZvz/2y5Auxsw0STvK671J7goZJwNME6jiYEcuvpGK1/1P224xmpe5vDo1s+ ncy/0Fe12Ag9s3UNEXlu1rc532Oh1p89uz3rS/rvyShfatgRvtlP10XkGq2EL5/82nAM +yOA== X-Gm-Message-State: APjAAAU3YS9hYbfFjqGCLLuqcX6rFIJP4wEpPXK1XJBaGg1BJKLkwogZ 7zAN0NMbM2lENcsrWMOBQfamTKxIZSk= X-Google-Smtp-Source: APXvYqxMXTStAMNaWIvYCJnp9oJm+iqRG0vAToyXtYgXHD0OxprRGB2fiKSALjtqSOLi96fR7S5TmQ== X-Received: by 2002:a63:d041:: with SMTP id s1mr306587pgi.363.1576630800717; Tue, 17 Dec 2019 17:00:00 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:bc97:5740:52a7:6875]) by smtp.gmail.com with ESMTPSA id r1sm240802pgp.15.2019.12.17.16.59.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Dec 2019 17:00:00 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 6/9] drm/virtio: move to_virtio_fence inside virtgpu_fence Date: Tue, 17 Dec 2019 16:59:26 -0800 Message-Id: <20191218005929.6709-7-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191218005929.6709-1-gurchetansingh@chromium.org> References: <20191218005929.6709-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: Gurchetan Singh , kraxel@redhat.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" That's the only file that uses it. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 -- drivers/gpu/drm/virtio/virtgpu_fence.c | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index 77f446608ca9..4ec80563d1ca 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -103,8 +103,6 @@ struct virtio_gpu_fence { struct virtio_gpu_fence_driver *drv; struct list_head node; }; -#define to_virtio_fence(x) \ - container_of(x, struct virtio_gpu_fence, f) struct virtio_gpu_vbuffer { char *buf; diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c b/drivers/gpu/drm/virtio/virtgpu_fence.c index 5466aab7d39a..5b2a4146c5bd 100644 --- a/drivers/gpu/drm/virtio/virtgpu_fence.c +++ b/drivers/gpu/drm/virtio/virtgpu_fence.c @@ -27,6 +27,9 @@ #include "virtgpu_drv.h" +#define to_virtio_fence(x) \ + container_of(x, struct virtio_gpu_fence, f) + static const char *virtio_get_driver_name(struct dma_fence *f) { return "virtio_gpu"; From patchwork Wed Dec 18 00:59:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11299239 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 6A8516C1 for ; Wed, 18 Dec 2019 01:00:11 +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 48926206D3 for ; Wed, 18 Dec 2019 01:00:11 +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="aSqrzXSN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48926206D3 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 8F30B6E20A; Wed, 18 Dec 2019 01:00:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3807A6E202 for ; Wed, 18 Dec 2019 01:00:04 +0000 (UTC) Received: by mail-pg1-x544.google.com with SMTP id b137so270959pga.6 for ; Tue, 17 Dec 2019 17:00:04 -0800 (PST) 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=a5B/ewjZpS/rPe+WDo9lDC1NlwyJ98tG2eeZPdSkLKI=; b=aSqrzXSNWOGtnC9y5qX7kEaJ7KC6M4Iow9E6fbnDFmAs2vfuHUcI6rNjgCUy0ejubn cUc3qbbFt+ge6uts3f6gzYJbCq+fHisoXU9cVg0+FCR8wriEw5+tsKs3/+YUsEsNJgGE 0RmVAJpCoHOrHrO1gQsWpuW5hsLo7MSAoekes= 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=a5B/ewjZpS/rPe+WDo9lDC1NlwyJ98tG2eeZPdSkLKI=; b=eiYAf1RJM23yP3RXSwKDHwhzB/4QlbSPqNaPxee5SmKqbOsjwSGh1XFpvNLcaiZz4R Ik8eme26uu21g2ofYRjHHFSwMJO1fcfhNQx3fHvKMvzN4KscybjtXUwv9RFealQhK24X ZtqpWoG2UILnVuUyn6D6prXsAME5O/cP1pSFgFXnfXPvLpswr3y1vkQ3oJTrqBPfyMcM U1G/Lxh29b+/BZnEz1A9HQp6H2mVF0ypfz2IpVUGlYoXv3KWPPA97xmKIbeV0JXwowlQ Af1szPLxfZazzT/YgpQEPFWXVmvFuKtmIJ7Yhyt5c8dIveBTdJpEJ2JvUGttGzFxdx98 fVfg== X-Gm-Message-State: APjAAAV5xWoOwPZT226EYKb+oT6GjM4jYiuQSLGRfqcP4P4u57ngvsHg kc/4zpJMzaewhDUlO0AG14S8XnDAeUg= X-Google-Smtp-Source: APXvYqzIfo8gj7NH0PhfzPDIPRy6SxwMBqtX41MAxiro/kY4a7QWIjY8894khDOyj8znWp6q0wte0Q== X-Received: by 2002:a65:408d:: with SMTP id t13mr292972pgp.441.1576630803618; Tue, 17 Dec 2019 17:00:03 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:bc97:5740:52a7:6875]) by smtp.gmail.com with ESMTPSA id r1sm240802pgp.15.2019.12.17.17.00.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Dec 2019 17:00:03 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 7/9] drm/virtio: move drm_connector_to_virtio_gpu_output to virtgpu_display Date: Tue, 17 Dec 2019 16:59:27 -0800 Message-Id: <20191218005929.6709-8-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191218005929.6709-1-gurchetansingh@chromium.org> References: <20191218005929.6709-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: Gurchetan Singh , kraxel@redhat.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" That's the only file that uses it. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/virtio/virtgpu_display.c | 3 +++ drivers/gpu/drm/virtio/virtgpu_drv.h | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index c76d69fecfeb..0966208ec30d 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -43,6 +43,9 @@ #define XRES_MAX 8192 #define YRES_MAX 8192 +#define drm_connector_to_virtio_gpu_output(x) \ + container_of(x, struct virtio_gpu_output, conn) + static const struct drm_crtc_funcs virtio_gpu_crtc_funcs = { .set_config = drm_atomic_helper_set_config, .destroy = drm_crtc_cleanup, diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index 4ec80563d1ca..7e447784e493 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -133,8 +133,6 @@ struct virtio_gpu_output { }; #define drm_crtc_to_virtio_gpu_output(x) \ container_of(x, struct virtio_gpu_output, crtc) -#define drm_connector_to_virtio_gpu_output(x) \ - container_of(x, struct virtio_gpu_output, conn) struct virtio_gpu_framebuffer { struct drm_framebuffer base; From patchwork Wed Dec 18 00:59:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11299237 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 1097C6C1 for ; Wed, 18 Dec 2019 01:00:09 +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 E29642146E for ; Wed, 18 Dec 2019 01:00:08 +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="DZAchr1Q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E29642146E 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 068A96E204; Wed, 18 Dec 2019 01:00:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 50B656E204 for ; Wed, 18 Dec 2019 01:00:06 +0000 (UTC) Received: by mail-pf1-x441.google.com with SMTP id q8so214756pfh.7 for ; Tue, 17 Dec 2019 17:00:06 -0800 (PST) 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=Sd1JRyd8keyIeKY2RfmaLJZxmSQ9jCuT9vMWsX8wfHY=; b=DZAchr1QVMXzlMddIhhmRRlL1/KJeapO+Smsc4is+fRUmsaK/Jsvv7hwzLLrNzibsC tUoSvGjUVqxZUKOpICt20jcQQTHw5Gsp0VBgf5/GiiZ96IqZZsVZ3T6CTfnYuv7U8Pe9 tlfvUF9vEnDEmbVbBynpOvtJ6lpZkEHzRjIXw= 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=Sd1JRyd8keyIeKY2RfmaLJZxmSQ9jCuT9vMWsX8wfHY=; b=fNuFUT0uDYcDEai3/44XWUmXSYaxiB2N9uy1dz5pxg3wHaoWdHjv+baCIdaaPLBzsz IgPMi/hfHmIUm4douaIxp9NOTGzBFEhuYj8HyBJtVTn2xdRZ21fy5BKsH391TQzka3cp mGVtW+9b3mdujaqUKYvedqk34KR9dlnOYACgLBarAICBM/Fa8zfS3e06KFkU+PRi0d3G pL2Po2RGuJkV4X7P9C3CZZg5+VAnoFIf4fcjJc6JlPF8BQJ0WwXeOCrcRn2obkA/eYWn hbbb5bPtk0Rbskn644dQVOG4EBYZi6u47U+Rgqhxb4WJWoZIYSXQr/AvpLzUoNMcjq4u EQHw== X-Gm-Message-State: APjAAAUhzDWhLAytOrBEzILMbCEgdnEWPykZcz9pzyz7Q8j7hyH28RnG W0nM/mHJv2bfW2usgggElRWeSUHrKS8= X-Google-Smtp-Source: APXvYqyK0rKKwV+N+RHFT3N37hWfAULYC8uBwbm/HGJjk8FKPJRnueY+jf1dmseR6aozJ3AJaYjdew== X-Received: by 2002:a63:4d4c:: with SMTP id n12mr936184pgl.212.1576630805434; Tue, 17 Dec 2019 17:00:05 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:bc97:5740:52a7:6875]) by smtp.gmail.com with ESMTPSA id r1sm240802pgp.15.2019.12.17.17.00.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Dec 2019 17:00:04 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 8/9] drm/virtio: split out vq functions from virtgpu_drv.h Date: Tue, 17 Dec 2019 16:59:28 -0800 Message-Id: <20191218005929.6709-9-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191218005929.6709-1-gurchetansingh@chromium.org> References: <20191218005929.6709-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: Gurchetan Singh , kraxel@redhat.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" virtgpu_drv.h is getting very big, let's try to split it into smaller header files. Start with virtgpu_vq. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/virtio/virtgpu_display.c | 1 + drivers/gpu/drm/virtio/virtgpu_drv.h | 79 ------------------ drivers/gpu/drm/virtio/virtgpu_gem.c | 1 + drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 + drivers/gpu/drm/virtio/virtgpu_kms.c | 1 + drivers/gpu/drm/virtio/virtgpu_object.c | 1 + drivers/gpu/drm/virtio/virtgpu_plane.c | 1 + drivers/gpu/drm/virtio/virtgpu_vq.c | 1 + drivers/gpu/drm/virtio/virtgpu_vq.h | 100 +++++++++++++++++++++++ 9 files changed, 107 insertions(+), 79 deletions(-) create mode 100644 drivers/gpu/drm/virtio/virtgpu_vq.h diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index 0966208ec30d..03cd5e40bfa1 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -33,6 +33,7 @@ #include #include "virtgpu_drv.h" +#include "virtgpu_vq.h" #define XRES_MIN 32 #define YRES_MIN 32 diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index 7e447784e493..cd98df412cda 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -250,85 +250,6 @@ void virtio_gpu_array_put_free_delayed(struct virtio_gpu_device *vgdev, struct virtio_gpu_object_array *objs); void virtio_gpu_array_put_free_work(struct work_struct *work); -/* virtio vg */ -int virtio_gpu_alloc_vbufs(struct virtio_gpu_device *vgdev); -void virtio_gpu_free_vbufs(struct virtio_gpu_device *vgdev); -void virtio_gpu_cmd_create_resource(struct virtio_gpu_device *vgdev, - struct virtio_gpu_object *bo, - struct virtio_gpu_object_params *params, - struct virtio_gpu_object_array *objs, - struct virtio_gpu_fence *fence); -void virtio_gpu_cmd_unref_resource(struct virtio_gpu_device *vgdev, - uint32_t resource_id); -void virtio_gpu_cmd_transfer_to_host_2d(struct virtio_gpu_device *vgdev, - uint64_t offset, - uint32_t width, uint32_t height, - uint32_t x, uint32_t y, - struct virtio_gpu_object_array *objs, - struct virtio_gpu_fence *fence); -void virtio_gpu_cmd_resource_flush(struct virtio_gpu_device *vgdev, - uint32_t resource_id, - uint32_t x, uint32_t y, - uint32_t width, uint32_t height); -void virtio_gpu_cmd_set_scanout(struct virtio_gpu_device *vgdev, - uint32_t scanout_id, uint32_t resource_id, - uint32_t width, uint32_t height, - uint32_t x, uint32_t y); -int virtio_gpu_object_attach(struct virtio_gpu_device *vgdev, - struct virtio_gpu_object *obj, - struct virtio_gpu_fence *fence); -void virtio_gpu_object_detach(struct virtio_gpu_device *vgdev, - struct virtio_gpu_object *obj); -int virtio_gpu_attach_status_page(struct virtio_gpu_device *vgdev); -int virtio_gpu_detach_status_page(struct virtio_gpu_device *vgdev); -void virtio_gpu_cursor_ping(struct virtio_gpu_device *vgdev, - struct virtio_gpu_output *output); -int virtio_gpu_cmd_get_display_info(struct virtio_gpu_device *vgdev); -int virtio_gpu_cmd_get_capset_info(struct virtio_gpu_device *vgdev, int idx); -int virtio_gpu_cmd_get_capset(struct virtio_gpu_device *vgdev, - int idx, int version, - struct virtio_gpu_drv_cap_cache **cache_p); -int virtio_gpu_cmd_get_edids(struct virtio_gpu_device *vgdev); -void virtio_gpu_cmd_context_create(struct virtio_gpu_device *vgdev, uint32_t id, - uint32_t nlen, const char *name); -void virtio_gpu_cmd_context_destroy(struct virtio_gpu_device *vgdev, - uint32_t id); -void virtio_gpu_cmd_context_attach_resource(struct virtio_gpu_device *vgdev, - uint32_t ctx_id, - struct virtio_gpu_object_array *objs); -void virtio_gpu_cmd_context_detach_resource(struct virtio_gpu_device *vgdev, - uint32_t ctx_id, - struct virtio_gpu_object_array *objs); -void virtio_gpu_cmd_submit(struct virtio_gpu_device *vgdev, - void *data, uint32_t data_size, - uint32_t ctx_id, - struct virtio_gpu_object_array *objs, - struct virtio_gpu_fence *fence); -void virtio_gpu_cmd_transfer_from_host_3d(struct virtio_gpu_device *vgdev, - uint32_t ctx_id, - uint64_t offset, uint32_t level, - struct drm_virtgpu_3d_box *box, - struct virtio_gpu_object_array *objs, - struct virtio_gpu_fence *fence); -void virtio_gpu_cmd_transfer_to_host_3d(struct virtio_gpu_device *vgdev, - uint32_t ctx_id, - uint64_t offset, uint32_t level, - struct drm_virtgpu_3d_box *box, - struct virtio_gpu_object_array *objs, - struct virtio_gpu_fence *fence); -void -virtio_gpu_cmd_resource_create_3d(struct virtio_gpu_device *vgdev, - struct virtio_gpu_object *bo, - struct virtio_gpu_object_params *params, - struct virtio_gpu_object_array *objs, - struct virtio_gpu_fence *fence); -void virtio_gpu_ctrl_ack(struct virtqueue *vq); -void virtio_gpu_cursor_ack(struct virtqueue *vq); -void virtio_gpu_fence_ack(struct virtqueue *vq); -void virtio_gpu_dequeue_ctrl_func(struct work_struct *work); -void virtio_gpu_dequeue_cursor_func(struct work_struct *work); -void virtio_gpu_dequeue_fence_func(struct work_struct *work); - /* virtio_gpu_display.c */ void virtio_gpu_modeset_init(struct virtio_gpu_device *vgdev); void virtio_gpu_modeset_fini(struct virtio_gpu_device *vgdev); diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c index 0a2b62279647..409dd3863c7b 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -27,6 +27,7 @@ #include #include "virtgpu_drv.h" +#include "virtgpu_vq.h" int virtio_gpu_gem_create(struct drm_file *file, struct drm_device *dev, diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index 205ec4abae2b..0108945b5cae 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -32,6 +32,7 @@ #include #include "virtgpu_drv.h" +#include "virtgpu_vq.h" static int virtio_gpu_map_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c index 2f5773e43557..2013002d3c2f 100644 --- a/drivers/gpu/drm/virtio/virtgpu_kms.c +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c @@ -29,6 +29,7 @@ #include #include "virtgpu_drv.h" +#include "virtgpu_vq.h" static void virtio_gpu_config_changed_work_func(struct work_struct *work) { diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c index 017a9e0fc3bb..8df93f40d282 100644 --- a/drivers/gpu/drm/virtio/virtgpu_object.c +++ b/drivers/gpu/drm/virtio/virtgpu_object.c @@ -26,6 +26,7 @@ #include #include "virtgpu_drv.h" +#include "virtgpu_vq.h" static int virtio_gpu_virglrenderer_workaround = 1; module_param_named(virglhack, virtio_gpu_virglrenderer_workaround, int, 0400); diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index bc4bc4475a8c..384796db9373 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -28,6 +28,7 @@ #include #include "virtgpu_drv.h" +#include "virtgpu_vq.h" static const uint32_t virtio_gpu_formats[] = { DRM_FORMAT_HOST_XRGB8888, diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index 9274c4063c70..4d1c357ada07 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -33,6 +33,7 @@ #include "virtgpu_drv.h" #include "virtgpu_trace.h" +#include "virtgpu_vq.h" #define MAX_INLINE_CMD_SIZE 96 #define MAX_INLINE_RESP_SIZE 24 diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.h b/drivers/gpu/drm/virtio/virtgpu_vq.h new file mode 100644 index 000000000000..06af7ef7f062 --- /dev/null +++ b/drivers/gpu/drm/virtio/virtgpu_vq.h @@ -0,0 +1,100 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef VIRTIO_VQ_H +#define VIRTIO_VQ_H + +struct drm_virtgpu_3d_box; + +struct virtio_gpu_device; +struct virtio_gpu_drv_cap_cache; + +struct virtio_gpu_fence; +struct virtio_gpu_framebuffer; + +struct virtio_gpu_object; +struct virtio_gpu_object_params; +struct virtio_gpu_object_array; +struct virtio_gpu_output; + +struct virtqueue; + +int virtio_gpu_alloc_vbufs(struct virtio_gpu_device *vgdev); +void virtio_gpu_free_vbufs(struct virtio_gpu_device *vgdev); +void virtio_gpu_cmd_create_resource(struct virtio_gpu_device *vgdev, + struct virtio_gpu_object *bo, + struct virtio_gpu_object_params *params, + struct virtio_gpu_object_array *objs, + struct virtio_gpu_fence *fence); +void virtio_gpu_cmd_unref_resource(struct virtio_gpu_device *vgdev, + uint32_t resource_id); +void virtio_gpu_cmd_transfer_to_host_2d(struct virtio_gpu_device *vgdev, + uint64_t offset, + uint32_t width, uint32_t height, + uint32_t x, uint32_t y, + struct virtio_gpu_object_array *objs, + struct virtio_gpu_fence *fence); +void virtio_gpu_cmd_resource_flush(struct virtio_gpu_device *vgdev, + uint32_t resource_id, + uint32_t x, uint32_t y, + uint32_t width, uint32_t height); +void virtio_gpu_cmd_set_scanout(struct virtio_gpu_device *vgdev, + uint32_t scanout_id, uint32_t resource_id, + uint32_t width, uint32_t height, + uint32_t x, uint32_t y); +int virtio_gpu_object_attach(struct virtio_gpu_device *vgdev, + struct virtio_gpu_object *obj, + struct virtio_gpu_fence *fence); +void virtio_gpu_object_detach(struct virtio_gpu_device *vgdev, + struct virtio_gpu_object *obj); +int virtio_gpu_attach_status_page(struct virtio_gpu_device *vgdev); +int virtio_gpu_detach_status_page(struct virtio_gpu_device *vgdev); +void virtio_gpu_cursor_ping(struct virtio_gpu_device *vgdev, + struct virtio_gpu_output *output); +int virtio_gpu_cmd_get_display_info(struct virtio_gpu_device *vgdev); +int virtio_gpu_cmd_get_capset_info(struct virtio_gpu_device *vgdev, int idx); +int virtio_gpu_cmd_get_capset(struct virtio_gpu_device *vgdev, + int idx, int version, + struct virtio_gpu_drv_cap_cache **cache_p); +int virtio_gpu_cmd_get_edids(struct virtio_gpu_device *vgdev); +void virtio_gpu_cmd_context_create(struct virtio_gpu_device *vgdev, uint32_t id, + uint32_t nlen, const char *name); +void virtio_gpu_cmd_context_destroy(struct virtio_gpu_device *vgdev, + uint32_t id); +void +virtio_gpu_cmd_context_attach_resource(struct virtio_gpu_device *vgdev, + uint32_t ctx_id, + struct virtio_gpu_object_array *objs); +void +virtio_gpu_cmd_context_detach_resource(struct virtio_gpu_device *vgdev, + uint32_t ctx_id, + struct virtio_gpu_object_array *objs); +void virtio_gpu_cmd_submit(struct virtio_gpu_device *vgdev, + void *data, uint32_t data_size, + uint32_t ctx_id, + struct virtio_gpu_object_array *objs, + struct virtio_gpu_fence *fence); +void virtio_gpu_cmd_transfer_from_host_3d(struct virtio_gpu_device *vgdev, + uint32_t ctx_id, + uint64_t offset, uint32_t level, + struct drm_virtgpu_3d_box *box, + struct virtio_gpu_object_array *objs, + struct virtio_gpu_fence *fence); +void virtio_gpu_cmd_transfer_to_host_3d(struct virtio_gpu_device *vgdev, + uint32_t ctx_id, + uint64_t offset, uint32_t level, + struct drm_virtgpu_3d_box *box, + struct virtio_gpu_object_array *objs, + struct virtio_gpu_fence *fence); +void +virtio_gpu_cmd_resource_create_3d(struct virtio_gpu_device *vgdev, + struct virtio_gpu_object *bo, + struct virtio_gpu_object_params *params, + struct virtio_gpu_object_array *objs, + struct virtio_gpu_fence *fence); +void virtio_gpu_ctrl_ack(struct virtqueue *vq); +void virtio_gpu_cursor_ack(struct virtqueue *vq); +void virtio_gpu_fence_ack(struct virtqueue *vq); +void virtio_gpu_dequeue_ctrl_func(struct work_struct *work); +void virtio_gpu_dequeue_cursor_func(struct work_struct *work); +void virtio_gpu_dequeue_fence_func(struct work_struct *work); + +#endif /* VIRTIO_GPU_VQ_H */ From patchwork Wed Dec 18 00:59:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11299241 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 1EE366C1 for ; Wed, 18 Dec 2019 01:00:15 +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 F0D042176D for ; Wed, 18 Dec 2019 01:00: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="YLnCSZmw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F0D042176D 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 41F126E20B; Wed, 18 Dec 2019 01:00:14 +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 7FD306E207 for ; Wed, 18 Dec 2019 01:00:08 +0000 (UTC) Received: by mail-pj1-x1041.google.com with SMTP id s7so60722pjc.0 for ; Tue, 17 Dec 2019 17:00:08 -0800 (PST) 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=xBz2QvCyQdAN8PKqjEK90M9isdrg6itoRexVBnrC8C0=; b=YLnCSZmw1VCTKp01SZcMmP4A568+mKmvpfuOKS5NVS6zqftaolXlejIySKALMq4NNz hCTtaeP3e6PKIgk7IstuGG5vhGj2lzIIF0ZMRvTWd7VE55RJW8VI61AkuWEkfW1xKkYm zzAxX6DNnxP97m4K/mxoomyYw6V2flWlCPqJY= 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=xBz2QvCyQdAN8PKqjEK90M9isdrg6itoRexVBnrC8C0=; b=CIuvzWCY8RPj48an8JKpoWgPyjXSk9NuQZwa6FoptYqrIEgvWpdeGVp3wtfFM4Dmr0 LIEioUtbLuMwZZbelBT0ghlLzns1J+hzI4ItdsHhNZm1ZzzL5Cz8qqVmle/dhwcI3s8i EdHDp8loTSPL/0V8nvtuHUGccbu6PxbCQluPPbk0v8c3ygt08ojLPOLpvSPJgYkZkOty vInTPgNatg3WbSIffM5Ap196bqH6GIZFHJ4xKy6qVA8bWnpud3+vaWCJTgFgnlYHHRVg zOVHnhB/U9T0Ns4kIvbMwm++/GW63kFpGphixVNqi+wjl0aRzIvRG8mdr/Qt+m0wdqcw HtZg== X-Gm-Message-State: APjAAAVFX3ejps3h4gn/XNqL5RzkYvnIs2nkzpVeNSqnJrzPUWlFiZF2 6ywPqT+NAWEoEkSPiyWZMfZUeh2WFx4= X-Google-Smtp-Source: APXvYqw1gS6LQVs2Z1qoIBMrQLDNsUWJNceJXR1Kw0D8j1rRH5YvtHR6TZ8Uut/ZSeHYhrdHbGhTFA== X-Received: by 2002:a17:90a:e98a:: with SMTP id v10mr228817pjy.67.1576630807755; Tue, 17 Dec 2019 17:00:07 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:bc97:5740:52a7:6875]) by smtp.gmail.com with ESMTPSA id r1sm240802pgp.15.2019.12.17.17.00.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Dec 2019 17:00:07 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 9/9] drm/virtio: split out gem functions from virtgpu_drv.h Date: Tue, 17 Dec 2019 16:59:29 -0800 Message-Id: <20191218005929.6709-10-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191218005929.6709-1-gurchetansingh@chromium.org> References: <20191218005929.6709-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: Gurchetan Singh , kraxel@redhat.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" virtgpu_drv.h is getting very big, let's try to split it into smaller header files. This time, GEM functions. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/virtio/virtgpu_drv.c | 1 + drivers/gpu/drm/virtio/virtgpu_drv.h | 34 ---------------- drivers/gpu/drm/virtio/virtgpu_gem.c | 1 + drivers/gpu/drm/virtio/virtgpu_gem.h | 52 +++++++++++++++++++++++++ drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 + drivers/gpu/drm/virtio/virtgpu_kms.c | 1 + drivers/gpu/drm/virtio/virtgpu_object.c | 1 + drivers/gpu/drm/virtio/virtgpu_plane.c | 1 + drivers/gpu/drm/virtio/virtgpu_vq.c | 1 + 9 files changed, 59 insertions(+), 34 deletions(-) create mode 100644 drivers/gpu/drm/virtio/virtgpu_gem.h diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c index e942465e4fb1..7bd46e915761 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.c +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c @@ -35,6 +35,7 @@ #include #include "virtgpu_drv.h" +#include "virtgpu_gem.h" static struct drm_driver driver; diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index cd98df412cda..fa921f07c331 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -216,40 +216,6 @@ void virtio_gpu_deinit(struct drm_device *dev); int virtio_gpu_driver_open(struct drm_device *dev, struct drm_file *file); void virtio_gpu_driver_postclose(struct drm_device *dev, struct drm_file *file); -/* virtio_gem.c */ -void virtio_gpu_gem_free_object(struct drm_gem_object *gem_obj); -int virtio_gpu_gem_init(struct virtio_gpu_device *vgdev); -void virtio_gpu_gem_fini(struct virtio_gpu_device *vgdev); -int virtio_gpu_gem_create(struct drm_file *file, - struct drm_device *dev, - struct virtio_gpu_object_params *params, - struct drm_gem_object **obj_p, - uint32_t *handle_p); -int virtio_gpu_gem_object_open(struct drm_gem_object *obj, - struct drm_file *file); -void virtio_gpu_gem_object_close(struct drm_gem_object *obj, - struct drm_file *file); -int virtio_gpu_mode_dumb_create(struct drm_file *file_priv, - struct drm_device *dev, - struct drm_mode_create_dumb *args); -int virtio_gpu_mode_dumb_mmap(struct drm_file *file_priv, - struct drm_device *dev, - uint32_t handle, uint64_t *offset_p); - -struct virtio_gpu_object_array *virtio_gpu_array_alloc(u32 nents); -struct virtio_gpu_object_array* -virtio_gpu_array_from_handles(struct drm_file *drm_file, u32 *handles, u32 nents); -void virtio_gpu_array_add_obj(struct virtio_gpu_object_array *objs, - struct drm_gem_object *obj); -int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs); -void virtio_gpu_array_unlock_resv(struct virtio_gpu_object_array *objs); -void virtio_gpu_array_add_fence(struct virtio_gpu_object_array *objs, - struct dma_fence *fence); -void virtio_gpu_array_put_free(struct virtio_gpu_object_array *objs); -void virtio_gpu_array_put_free_delayed(struct virtio_gpu_device *vgdev, - struct virtio_gpu_object_array *objs); -void virtio_gpu_array_put_free_work(struct work_struct *work); - /* virtio_gpu_display.c */ void virtio_gpu_modeset_init(struct virtio_gpu_device *vgdev); void virtio_gpu_modeset_fini(struct virtio_gpu_device *vgdev); diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c index 409dd3863c7b..61cfc9e11f75 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -27,6 +27,7 @@ #include #include "virtgpu_drv.h" +#include "virtgpu_gem.h" #include "virtgpu_vq.h" int virtio_gpu_gem_create(struct drm_file *file, diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.h b/drivers/gpu/drm/virtio/virtgpu_gem.h new file mode 100644 index 000000000000..2ee81980e384 --- /dev/null +++ b/drivers/gpu/drm/virtio/virtgpu_gem.h @@ -0,0 +1,52 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef VIRTIO_GEM_H +#define VIRTIO_GEM_H + +#include + +struct dma_fence; +struct drm_device; +struct drm_file; +struct drm_gem_object; + +struct virtio_gpu_device; +struct virtio_gpu_object_array; +struct virtio_gpu_object_params; + +struct work_struct; + +void virtio_gpu_gem_free_object(struct drm_gem_object *gem_obj); +int virtio_gpu_gem_init(struct virtio_gpu_device *vgdev); +void virtio_gpu_gem_fini(struct virtio_gpu_device *vgdev); +int virtio_gpu_gem_create(struct drm_file *file, + struct drm_device *dev, + struct virtio_gpu_object_params *params, + struct drm_gem_object **obj_p, + uint32_t *handle_p); +int virtio_gpu_gem_object_open(struct drm_gem_object *obj, + struct drm_file *file); +void virtio_gpu_gem_object_close(struct drm_gem_object *obj, + struct drm_file *file); +int virtio_gpu_mode_dumb_create(struct drm_file *file_priv, + struct drm_device *dev, + struct drm_mode_create_dumb *args); +int virtio_gpu_mode_dumb_mmap(struct drm_file *file_priv, + struct drm_device *dev, + uint32_t handle, uint64_t *offset_p); + +struct virtio_gpu_object_array *virtio_gpu_array_alloc(u32 nents); +struct virtio_gpu_object_array* +virtio_gpu_array_from_handles(struct drm_file *drm_file, u32 *handles, + u32 nents); +void virtio_gpu_array_add_obj(struct virtio_gpu_object_array *objs, + struct drm_gem_object *obj); +int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs); +void virtio_gpu_array_unlock_resv(struct virtio_gpu_object_array *objs); +void virtio_gpu_array_add_fence(struct virtio_gpu_object_array *objs, + struct dma_fence *fence); +void virtio_gpu_array_put_free(struct virtio_gpu_object_array *objs); +void virtio_gpu_array_put_free_delayed(struct virtio_gpu_device *vgdev, + struct virtio_gpu_object_array *objs); +void virtio_gpu_array_put_free_work(struct work_struct *work); + +#endif /* VIRTGPU_GEM_H */ diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index 0108945b5cae..2dc394170566 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -32,6 +32,7 @@ #include #include "virtgpu_drv.h" +#include "virtgpu_gem.h" #include "virtgpu_vq.h" static int virtio_gpu_map_ioctl(struct drm_device *dev, void *data, diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c index 2013002d3c2f..a8aaff30d021 100644 --- a/drivers/gpu/drm/virtio/virtgpu_kms.c +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c @@ -29,6 +29,7 @@ #include #include "virtgpu_drv.h" +#include "virtgpu_gem.h" #include "virtgpu_vq.h" static void virtio_gpu_config_changed_work_func(struct work_struct *work) diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c index 8df93f40d282..2060662e3f46 100644 --- a/drivers/gpu/drm/virtio/virtgpu_object.c +++ b/drivers/gpu/drm/virtio/virtgpu_object.c @@ -26,6 +26,7 @@ #include #include "virtgpu_drv.h" +#include "virtgpu_gem.h" #include "virtgpu_vq.h" static int virtio_gpu_virglrenderer_workaround = 1; diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index 384796db9373..84156147d549 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -28,6 +28,7 @@ #include #include "virtgpu_drv.h" +#include "virtgpu_gem.h" #include "virtgpu_vq.h" static const uint32_t virtio_gpu_formats[] = { diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index 4d1c357ada07..00f17a40671d 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -32,6 +32,7 @@ #include #include "virtgpu_drv.h" +#include "virtgpu_gem.h" #include "virtgpu_trace.h" #include "virtgpu_vq.h"