From patchwork Tue May 11 01:49:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Tina" X-Patchwork-Id: 12249475 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98756C433B4 for ; Tue, 11 May 2021 01:57: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 48AA86147D for ; Tue, 11 May 2021 01:57:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48AA86147D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com 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 A96B96E99D; Tue, 11 May 2021 01:57:06 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7B8B26E99B for ; Tue, 11 May 2021 01:57:05 +0000 (UTC) IronPort-SDR: Ob4F2dibUzrWzCSwhDgkbgmBQKr37Ad99OU0XOFBhkW0JS9SUMGMxUt5N7LE/3oQ59H0NJO61y ad9dJpI9ouDg== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="196239147" X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="196239147" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 18:57:00 -0700 IronPort-SDR: RDE+T5p3xlMsTG0pDUpcnNl6m1baaDH5mx5RKu4+5nJiJWsPeE1MTRg4GvF0z0EKqhBGlgmEn/ OuElEzPywBpA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="434067386" Received: from test.bj.intel.com ([10.238.158.204]) by fmsmga008.fm.intel.com with ESMTP; 10 May 2021 18:56:58 -0700 From: Tina Zhang To: dri-devel@lists.freedesktop.org Subject: [PATCH RFC 1/3] drm: Add drm_plane_add_modifiers() Date: Mon, 10 May 2021 21:49:38 -0400 Message-Id: <20210511014940.2067715-2-tina.zhang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210511014940.2067715-1-tina.zhang@intel.com> References: <20210511014940.2067715-1-tina.zhang@intel.com> 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 , Gerd Hoffmann , Vivek Kasireddy , Tina Zhang Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add a function to add modifiers to a plane. Signed-off-by: Tina Zhang --- drivers/gpu/drm/drm_plane.c | 41 +++++++++++++++++++++++++++++++++++++ include/drm/drm_plane.h | 3 +++ 2 files changed, 44 insertions(+) diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index b570a480090a..793b16d84f86 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -288,6 +288,47 @@ int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane, } EXPORT_SYMBOL(drm_universal_plane_init); +int drm_plane_add_modifiers(struct drm_device *dev, + struct drm_plane *plane, + const uint64_t *format_modifiers) +{ + struct drm_mode_config *config = &dev->mode_config; + const uint64_t *temp_modifiers = format_modifiers; + unsigned int format_modifier_count = 0; + + /* + * Only considering adding modifiers when no modifier was + * added to that plane before. + */ + if (!temp_modifiers || plane->modifier_count) + return -EINVAL; + + while (*temp_modifiers++ != DRM_FORMAT_MOD_INVALID) + format_modifier_count++; + + if (format_modifier_count) + config->allow_fb_modifiers = true; + + plane->modifier_count = format_modifier_count; + plane->modifiers = kmalloc_array(format_modifier_count, + sizeof(format_modifiers[0]), + GFP_KERNEL); + + if (format_modifier_count && !plane->modifiers) { + DRM_DEBUG_KMS("out of memory when allocating plane\n"); + return -ENOMEM; + } + + memcpy(plane->modifiers, format_modifiers, + format_modifier_count * sizeof(format_modifiers[0])); + if (config->allow_fb_modifiers) + create_in_format_blob(dev, plane); + + return 0; +} +EXPORT_SYMBOL(drm_plane_add_modifiers); + + int drm_plane_register_all(struct drm_device *dev) { unsigned int num_planes = 0; diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h index 50c23eb432b7..0dacdeffc3bc 100644 --- a/include/drm/drm_plane.h +++ b/include/drm/drm_plane.h @@ -827,6 +827,9 @@ int drm_universal_plane_init(struct drm_device *dev, const uint64_t *format_modifiers, enum drm_plane_type type, const char *name, ...); +int drm_plane_add_modifiers(struct drm_device *dev, + struct drm_plane *plane, + const uint64_t *format_modifiers); int drm_plane_init(struct drm_device *dev, struct drm_plane *plane, uint32_t possible_crtcs, From patchwork Tue May 11 01:49:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Tina" X-Patchwork-Id: 12249473 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15D86C433B4 for ; Tue, 11 May 2021 01:57:13 +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 BEA3A6147D for ; Tue, 11 May 2021 01:57:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BEA3A6147D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com 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 9FCD96E99B; Tue, 11 May 2021 01:57:06 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5CBDD6E992 for ; Tue, 11 May 2021 01:57:05 +0000 (UTC) IronPort-SDR: PUwaTJB7dXd4y64kWAh0Ex+xULbtUtkl2b6udNId/k3+nvWKsRK/21MFJWJKOW8NxsEDfJsMUl S04sZ883pWBA== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="196239151" X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="196239151" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 18:57:02 -0700 IronPort-SDR: kb4oFKmtqkc5bPrsff6zOENfbki0lWSYOXq5fqZ0Qn+NltBnx2X7tIlP3Z42IAe5a4fvNDkAy/ /SsQJMm4nzfQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="434067405" Received: from test.bj.intel.com ([10.238.158.204]) by fmsmga008.fm.intel.com with ESMTP; 10 May 2021 18:56:59 -0700 From: Tina Zhang To: dri-devel@lists.freedesktop.org Subject: [PATCH RFC 2/3] drm/virtio: Add modifier support Date: Mon, 10 May 2021 21:49:39 -0400 Message-Id: <20210511014940.2067715-3-tina.zhang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210511014940.2067715-1-tina.zhang@intel.com> References: <20210511014940.2067715-1-tina.zhang@intel.com> 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 , Gerd Hoffmann , Vivek Kasireddy , Tina Zhang Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add a command to get modifier info from the backend. Signed-off-by: Tina Zhang --- drivers/gpu/drm/virtio/virtgpu_drv.h | 3 ++ drivers/gpu/drm/virtio/virtgpu_kms.c | 3 ++ drivers/gpu/drm/virtio/virtgpu_plane.c | 16 ++++++++++ drivers/gpu/drm/virtio/virtgpu_vq.c | 42 ++++++++++++++++++++++++++ include/uapi/linux/virtio_gpu.h | 8 +++++ 5 files changed, 72 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index d9dbc4f258f3..e077ea065558 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -250,6 +250,8 @@ struct virtio_gpu_device { spinlock_t resource_export_lock; /* protects map state and host_visible_mm */ spinlock_t host_visible_lock; + + u64 modifiers[VIRTIO_GPU_PLANE_MAX_MODIFIERS]; }; struct virtio_gpu_fpriv { @@ -329,6 +331,7 @@ 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_plane_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, diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c index b4ec479c32cd..3ecf36d92c5c 100644 --- a/drivers/gpu/drm/virtio/virtgpu_kms.c +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c @@ -226,6 +226,9 @@ int virtio_gpu_init(struct drm_device *dev) virtio_gpu_notify(vgdev); wait_event_timeout(vgdev->resp_wq, !vgdev->display_info_pending, 5 * HZ); + + virtio_gpu_cmd_get_plane_info(vgdev); + return 0; err_scanouts: diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index 42ac08ed1442..1b9b2a7bf0ac 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -73,6 +73,20 @@ static void virtio_gpu_plane_destroy(struct drm_plane *plane) kfree(plane); } +static bool virtio_plane_format_mod_supported(struct drm_plane *plane, + u32 format, u64 modifier) +{ + struct drm_device *dev = plane->dev; + struct virtio_gpu_device *vgdev = dev->dev_private; + int i; + + for (i = 0; i < VIRTIO_GPU_PLANE_MAX_MODIFIERS; i++) + if (modifier == vgdev->modifiers[i]) + return true; + + return false; +} + static const struct drm_plane_funcs virtio_gpu_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, @@ -80,6 +94,7 @@ static const struct drm_plane_funcs virtio_gpu_plane_funcs = { .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, + .format_mod_supported = virtio_plane_format_mod_supported, }; static int virtio_gpu_plane_atomic_check(struct drm_plane *plane, @@ -348,6 +363,7 @@ struct drm_plane *virtio_gpu_plane_init(struct virtio_gpu_device *vgdev, nformats = ARRAY_SIZE(virtio_gpu_formats); funcs = &virtio_gpu_primary_helper_funcs; } + ret = drm_universal_plane_init(dev, plane, 1 << index, &virtio_gpu_plane_funcs, formats, nformats, diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index cf84d382dd41..7a6d6628e167 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -678,6 +678,26 @@ static void virtio_gpu_cmd_get_display_info_cb(struct virtio_gpu_device *vgdev, drm_kms_helper_hotplug_event(vgdev->ddev); } +static void virtio_gpu_cmd_get_plane_info_cb(struct virtio_gpu_device *vgdev, + struct virtio_gpu_vbuffer *vbuf) +{ + struct drm_device *dev = vgdev->ddev; + struct virtio_gpu_output *output = vgdev->outputs; + struct drm_crtc *crtc = &output->crtc; + struct virtio_gpu_resp_plane_info *resp = + (struct virtio_gpu_resp_plane_info *)vbuf->resp_buf; + int i; + + for (i = 0; i < VIRTIO_GPU_PLANE_MAX_MODIFIERS; i++) { + vgdev->modifiers[i] = resp->modifiers[i]; + if (vgdev->modifiers[i] == DRM_FORMAT_MOD_INVALID) + break; + } + + if (i < VIRTIO_GPU_PLANE_MAX_MODIFIERS) + drm_plane_add_modifiers(dev, crtc->primary, vgdev->modifiers); +} + static void virtio_gpu_cmd_get_capset_info_cb(struct virtio_gpu_device *vgdev, struct virtio_gpu_vbuffer *vbuf) { @@ -786,6 +806,28 @@ int virtio_gpu_cmd_get_display_info(struct virtio_gpu_device *vgdev) return 0; } +int virtio_gpu_cmd_get_plane_info(struct virtio_gpu_device *vgdev) +{ + struct virtio_gpu_ctrl_hdr *cmd_p; + struct virtio_gpu_vbuffer *vbuf; + void *resp_buf; + + resp_buf = kzalloc(sizeof(struct virtio_gpu_resp_plane_info), + GFP_KERNEL); + if (!resp_buf) + return -ENOMEM; + + cmd_p = virtio_gpu_alloc_cmd_resp + (vgdev, &virtio_gpu_cmd_get_plane_info_cb, &vbuf, + sizeof(*cmd_p), sizeof(struct virtio_gpu_resp_plane_info), + resp_buf); + memset(cmd_p, 0, sizeof(*cmd_p)); + + cmd_p->type = cpu_to_le32(VIRTIO_GPU_CMD_GET_PLANE_INFO); + virtio_gpu_queue_ctrl_buffer(vgdev, vbuf); + return 0; +} + int virtio_gpu_cmd_get_capset_info(struct virtio_gpu_device *vgdev, int idx) { struct virtio_gpu_get_capset_info *cmd_p; diff --git a/include/uapi/linux/virtio_gpu.h b/include/uapi/linux/virtio_gpu.h index 97523a95781d..f853d7672175 100644 --- a/include/uapi/linux/virtio_gpu.h +++ b/include/uapi/linux/virtio_gpu.h @@ -78,6 +78,7 @@ enum virtio_gpu_ctrl_type { VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID, VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB, VIRTIO_GPU_CMD_SET_SCANOUT_BLOB, + VIRTIO_GPU_CMD_GET_PLANE_INFO, /* 3d commands */ VIRTIO_GPU_CMD_CTX_CREATE = 0x0200, @@ -103,6 +104,7 @@ enum virtio_gpu_ctrl_type { VIRTIO_GPU_RESP_OK_EDID, VIRTIO_GPU_RESP_OK_RESOURCE_UUID, VIRTIO_GPU_RESP_OK_MAP_INFO, + VIRTIO_GPU_RESP_OK_PLANE_INFO, /* error responses */ VIRTIO_GPU_RESP_ERR_UNSPEC = 0x1200, @@ -232,6 +234,12 @@ struct virtio_gpu_resp_display_info { } pmodes[VIRTIO_GPU_MAX_SCANOUTS]; }; +#define VIRTIO_GPU_PLANE_MAX_MODIFIERS 8 +struct virtio_gpu_resp_plane_info { + struct virtio_gpu_ctrl_hdr hdr; + __le64 modifiers[VIRTIO_GPU_PLANE_MAX_MODIFIERS]; +}; + /* data passed in the control vq, 3d related */ struct virtio_gpu_box { From patchwork Tue May 11 01:49:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Tina" X-Patchwork-Id: 12249477 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59CF1C433ED for ; Tue, 11 May 2021 01:57:17 +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 209966147D for ; Tue, 11 May 2021 01:57:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 209966147D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com 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 2653E6E9A0; Tue, 11 May 2021 01:57:07 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id A96546E992 for ; Tue, 11 May 2021 01:57:05 +0000 (UTC) IronPort-SDR: 15Fweannt0ZE9I94ZQWDgQ6cLNfAmmm1n9fg0adMkHzXMCaQWU9VHMzAiwzFfr124T6pgWG4lY 15KofwHmBKYw== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="196239159" X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="196239159" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 18:57:03 -0700 IronPort-SDR: 1k4AxCHNciJMtr5uW65KOB5o6FZvQctQwYoW7utpCd5nm8EqV+CAsy2HM/FwAqJPuuk6eHAVoo 0oPRk4shB78w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="434067424" Received: from test.bj.intel.com ([10.238.158.204]) by fmsmga008.fm.intel.com with ESMTP; 10 May 2021 18:57:01 -0700 From: Tina Zhang To: dri-devel@lists.freedesktop.org Subject: [PATCH RFC 3/3] drm/virtio: Include modifier as part of set_scanout_blob Date: Mon, 10 May 2021 21:49:40 -0400 Message-Id: <20210511014940.2067715-4-tina.zhang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210511014940.2067715-1-tina.zhang@intel.com> References: <20210511014940.2067715-1-tina.zhang@intel.com> 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 , Tina Zhang , Vivek Kasireddy , Gerd Hoffmann Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Vivek Kasireddy With new use-cases coming up that include virtio-gpu: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9592 the FB associated with a Guest blob may have a modifier. Therefore, this modifier info needs to be included as part of set_scanout_blob. v2: (Tina) * Use drm_plane_add_modifiers() to set allow_fb_modifiers. * Append the modifier field to the virtio_gpu_set_scanout_blob struct. Signed-off-by: Vivek Kasireddy Signed-off-by: Tina Zhang --- drivers/gpu/drm/virtio/virtgpu_vq.c | 3 ++- include/uapi/linux/virtio_gpu.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index 7a6d6628e167..351befed105a 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -34,7 +34,7 @@ #include "virtgpu_drv.h" #include "virtgpu_trace.h" -#define MAX_INLINE_CMD_SIZE 96 +#define MAX_INLINE_CMD_SIZE 112 #define MAX_INLINE_RESP_SIZE 24 #define VBUFFER_SIZE (sizeof(struct virtio_gpu_vbuffer) \ + MAX_INLINE_CMD_SIZE \ @@ -1336,6 +1336,7 @@ void virtio_gpu_cmd_set_scanout_blob(struct virtio_gpu_device *vgdev, cmd_p->format = cpu_to_le32(format); cmd_p->width = cpu_to_le32(fb->width); cmd_p->height = cpu_to_le32(fb->height); + cmd_p->modifier = cpu_to_le64(fb->modifier); for (i = 0; i < 4; i++) { cmd_p->strides[i] = cpu_to_le32(fb->pitches[i]); diff --git a/include/uapi/linux/virtio_gpu.h b/include/uapi/linux/virtio_gpu.h index f853d7672175..6d08481ac4ef 100644 --- a/include/uapi/linux/virtio_gpu.h +++ b/include/uapi/linux/virtio_gpu.h @@ -420,6 +420,7 @@ struct virtio_gpu_set_scanout_blob { __le32 padding; __le32 strides[4]; __le32 offsets[4]; + __le64 modifier; }; /* VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB */