From nobody Sun May 5 02:51:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1558681575; cv=none; d=zoho.com; s=zohoarc; b=W0Gts/RCyHWeY6470KHNWR3GwtYWzSm5hwTMc95mzZ03yEhuuRRg1z++jEE/jC8PtW66n/OYSuDPbT9YufR94o7rnMO+BJhU9KUGSgssf7/Y9tvTBGqOVo/mJSHih0oxRcGlygemzWamqVDRq6eZ6nmoXgBIPVYWGtMkT2t5yW0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558681575; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=V6bBzArMHaSg72FGBnXS58VwzBXg+LMev1YZY6SIH7w=; b=Zpy/ifuVD/Ek+0Ih4PkRhK9y1Q75bWd+z422oQ+hBNguZkWSlUIcOa0kWXGR/badt7gZWqU99wkFRxKqB9+gElZsME3ZW9IZslCMvk9pFogGg4/9/NKgege9SqSzvHfWvA1/SdeCydvIYDsAWwQMJe1exJOlxdfmyVQVft6GSTA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558681575115763.2503494889705; Fri, 24 May 2019 00:06:15 -0700 (PDT) Received: from localhost ([127.0.0.1]:50123 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hU4HL-0007RZ-4l for importer@patchew.org; Fri, 24 May 2019 03:06:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hU4Cp-00044g-0b for qemu-devel@nongnu.org; Fri, 24 May 2019 03:01:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hU4Cn-0005Gb-9c for qemu-devel@nongnu.org; Fri, 24 May 2019 03:01:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52918) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hU4Cm-0005Fp-AG for qemu-devel@nongnu.org; Fri, 24 May 2019 03:01:29 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 02429D7809 for ; Fri, 24 May 2019 07:01:27 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-101.ams2.redhat.com [10.36.116.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id D571919C4F; Fri, 24 May 2019 07:01:21 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 92AF317536; Fri, 24 May 2019 09:01:18 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 24 May 2019 09:01:15 +0200 Message-Id: <20190524070118.30157-2-kraxel@redhat.com> In-Reply-To: <20190524070118.30157-1-kraxel@redhat.com> References: <20190524070118.30157-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 24 May 2019 07:01:27 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 1/4] console: add dmabuf modifier field. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Williamson , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" dmabufs can have a format modifier (DRM_FORMAT_MOD_*) which is used for tiled layouts for example. Add a field to QemuDmaBuf so we can carry around that information. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau --- include/ui/console.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/ui/console.h b/include/ui/console.h index fef900db76a5..f9816968487c 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -175,6 +175,7 @@ typedef struct QemuDmaBuf { uint32_t height; uint32_t stride; uint32_t fourcc; + uint64_t modifier; uint32_t texture; bool y0_top; } QemuDmaBuf; --=20 2.18.1 From nobody Sun May 5 02:51:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1558681415; cv=none; d=zoho.com; s=zohoarc; b=CdvYrNDL61G+dd0u0qDg/woDThiI36Q7EMOMKTcJyOy4qATmazThYV+dN+PJV/eoBAJxMYVkUB16RT0J3FmF7ljatxPePFVO6zRPD/lpOLcnqm4WvlEbHFQGtkIDhGrEcHq3kVq8d8mTpt1pSrCROk+CMLkctx3fTmKhPi6AthE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558681415; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=jL6mtFv+/WjwF909upSV8nfB83IIf3BCCRaYQbkN+98=; b=k+776kSHwKtZBZO5NNJ4AGUQPIbh6x9byOIZGMIo/ipfFR1K2I5d4h8DNiW/MTID5LgPKWD44ZEnOaz55/JU+nkL2etLcO6iP6/hgx2eTx3cpnyOtCIJMi24qepm4pvO7ajgxYDdbKDbyGgIlmzGLgiwTokbW/ILEsk8+90I2Ps= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558681415177918.4346748408551; Fri, 24 May 2019 00:03:35 -0700 (PDT) Received: from localhost ([127.0.0.1]:50068 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hU4Ec-0004vW-Sv for importer@patchew.org; Fri, 24 May 2019 03:03:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hU4Cp-00044h-1N for qemu-devel@nongnu.org; Fri, 24 May 2019 03:01:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hU4Cn-0005Gj-Dw for qemu-devel@nongnu.org; Fri, 24 May 2019 03:01:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52606) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hU4Cn-0005G3-0r for qemu-devel@nongnu.org; Fri, 24 May 2019 03:01:29 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C189A3081244 for ; Fri, 24 May 2019 07:01:27 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-101.ams2.redhat.com [10.36.116.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id D89E560C9E; Fri, 24 May 2019 07:01:21 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9AA2617538; Fri, 24 May 2019 09:01:18 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 24 May 2019 09:01:16 +0200 Message-Id: <20190524070118.30157-3-kraxel@redhat.com> In-Reply-To: <20190524070118.30157-1-kraxel@redhat.com> References: <20190524070118.30157-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 24 May 2019 07:01:27 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 2/4] vfio/display: set dmabuf modifier field X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Williamson , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Fill the new QemuDmaBuf->modifier field properly from plane info. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau Acked-by: Alex Williamson --- hw/vfio/display.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/display.c b/hw/vfio/display.c index a3d9c8f5beac..13969180b2dd 100644 --- a/hw/vfio/display.c +++ b/hw/vfio/display.c @@ -248,6 +248,7 @@ static VFIODMABuf *vfio_display_get_dmabuf(VFIOPCIDevic= e *vdev, dmabuf->buf.height =3D plane.height; dmabuf->buf.stride =3D plane.stride; dmabuf->buf.fourcc =3D plane.drm_format; + dmabuf->buf.modifier =3D plane.drm_format_mod; dmabuf->buf.fd =3D fd; if (plane_type =3D=3D DRM_PLANE_TYPE_CURSOR) { vfio_display_update_cursor(dmabuf, &plane); --=20 2.18.1 From nobody Sun May 5 02:51:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1558681711; cv=none; d=zoho.com; s=zohoarc; b=PQ9zJwl7maxRD6k52ooEn/RKmP/SdKm+UqzqtcL6B1b6EHB8S3i/qp/iVZk+5vYLWLB/bOmO3v4ZIrv/zLBiUOX1yFOpsw/oWwxL7G6hYJ3H6bKyCzwv3Q1uE4IcjEHhk3XdkA+9EN5YLZt/1Fu7Mw6dlT98s0FlD07cA3WTnbU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558681711; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=FJk32hc7/YMpGBhTQd9LE+7nRTe5VEgCkEHnJ8KV7Ws=; b=DsDxytq7ScB9Yduz8Afmjn/c6G1FQ5S2KH2y/sDMm1IW9Ex4N+HxMMv4AH2n2Gsw/VJYI9zeVlF/yDURhUNxOLpu5OSVAeti/mta3H10GGNv688hsRQ4fY2YfhhvHmvJ+qLmqft33MrkglFCe6emb7ubcRkW3K6a2PzE/nVqfvg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558681711805895.558892207128; Fri, 24 May 2019 00:08:31 -0700 (PDT) Received: from localhost ([127.0.0.1]:50141 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hU4JY-0001EI-LK for importer@patchew.org; Fri, 24 May 2019 03:08:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hU4D9-0004GI-FO for qemu-devel@nongnu.org; Fri, 24 May 2019 03:01:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hU4D8-0005Qi-DH for qemu-devel@nongnu.org; Fri, 24 May 2019 03:01:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47650) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hU4D8-0005K0-5Q for qemu-devel@nongnu.org; Fri, 24 May 2019 03:01:50 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9F574307CB5F for ; Fri, 24 May 2019 07:01:27 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-101.ams2.redhat.com [10.36.116.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 015085B683; Fri, 24 May 2019 07:01:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A53441753A; Fri, 24 May 2019 09:01:18 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 24 May 2019 09:01:17 +0200 Message-Id: <20190524070118.30157-4-kraxel@redhat.com> In-Reply-To: <20190524070118.30157-1-kraxel@redhat.com> References: <20190524070118.30157-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 24 May 2019 07:01:27 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 3/4] egl-helpers: add modifier support to egl_get_fd_for_texture(). X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Williamson , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add modifier parameter to egl_get_fd_for_texture(), to return the used modifier on dmabuf exports. Signed-off-by: Gerd Hoffmann --- include/ui/egl-helpers.h | 3 ++- ui/egl-helpers.c | 5 +++-- ui/spice-display.c | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/ui/egl-helpers.h b/include/ui/egl-helpers.h index b976cb872821..d71412779913 100644 --- a/include/ui/egl-helpers.h +++ b/include/ui/egl-helpers.h @@ -36,7 +36,8 @@ extern struct gbm_device *qemu_egl_rn_gbm_dev; extern EGLContext qemu_egl_rn_ctx; =20 int egl_rendernode_init(const char *rendernode, DisplayGLMode mode); -int egl_get_fd_for_texture(uint32_t tex_id, EGLint *stride, EGLint *fourcc= ); +int egl_get_fd_for_texture(uint32_t tex_id, EGLint *stride, EGLint *fourcc, + EGLuint64KHR *modifier); =20 void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf); void egl_dmabuf_release_texture(QemuDmaBuf *dmabuf); diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index e90eef8c9c3a..0c9716067cfb 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -200,7 +200,8 @@ err: return -1; } =20 -int egl_get_fd_for_texture(uint32_t tex_id, EGLint *stride, EGLint *fourcc) +int egl_get_fd_for_texture(uint32_t tex_id, EGLint *stride, EGLint *fourcc, + EGLuint64KHR *modifier) { EGLImageKHR image; EGLint num_planes, fd; @@ -214,7 +215,7 @@ int egl_get_fd_for_texture(uint32_t tex_id, EGLint *str= ide, EGLint *fourcc) } =20 eglExportDMABUFImageQueryMESA(qemu_egl_display, image, fourcc, - &num_planes, NULL); + &num_planes, modifier); if (num_planes !=3D 1) { eglDestroyImageKHR(qemu_egl_display, image); return -1; diff --git a/ui/spice-display.c b/ui/spice-display.c index a5e26479a866..104df2302575 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -888,7 +888,8 @@ static void spice_gl_switch(DisplayChangeListener *dcl, if (ssd->ds) { surface_gl_create_texture(ssd->gls, ssd->ds); fd =3D egl_get_fd_for_texture(ssd->ds->texture, - &stride, &fourcc); + &stride, &fourcc, + NULL); if (fd < 0) { surface_gl_destroy_texture(ssd->gls, ssd->ds); return; @@ -945,7 +946,7 @@ static void qemu_spice_gl_scanout_texture(DisplayChange= Listener *dcl, int fd =3D -1; =20 assert(tex_id); - fd =3D egl_get_fd_for_texture(tex_id, &stride, &fourcc); + fd =3D egl_get_fd_for_texture(tex_id, &stride, &fourcc, NULL); if (fd < 0) { fprintf(stderr, "%s: failed to get fd for texture\n", __func__); return; @@ -1063,7 +1064,7 @@ static void qemu_spice_gl_update(DisplayChangeListene= r *dcl, egl_fb_setup_new_tex(&ssd->blit_fb, dmabuf->width, dmabuf->height); fd =3D egl_get_fd_for_texture(ssd->blit_fb.texture, - &stride, &fourcc); + &stride, &fourcc, NULL); spice_qxl_gl_scanout(&ssd->qxl, fd, dmabuf->width, dmabuf->height, stride, fourcc, false); --=20 2.18.1 From nobody Sun May 5 02:51:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1558681423; cv=none; d=zoho.com; s=zohoarc; b=ZxllPgNYNL3ys5znORRuMJHubR9MfBgypKGT5+b6eaVekWY0R1GYx9e2YPGiPnvQ97MtnenXCgcCGU0rsTI+2FZsQvhO4uOHH7jwWYmBzsqZppddtnPcibTGYmlYZ97GR4jaoH1Op7e+f5PkYNqkUoo1GFde8zwlPbLjfsmh5sY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558681423; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=rYacYSTidfS1XKWiktH/uwX5j/aGoF3IjF/9Dg20Ih4=; b=WXH7ZGzxGwlvDO5zRoh7MBYiYScXyAfjC3ZJVFX3AUgXe/eA9xQ1IORtV/H6JUxiJNlgWrhmP6/7EFuvfIGQFLNYKTP3XUUAq2hWRbJpepC0AlKFkE94buaUnAOsadjdANvdtRzEnfTzLmi7YGfbo39/CrGciuGTac7uhvVsixI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558681423144658.7248697718956; Fri, 24 May 2019 00:03:43 -0700 (PDT) Received: from localhost ([127.0.0.1]:50066 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hU4Eb-0004u6-RI for importer@patchew.org; Fri, 24 May 2019 03:03:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hU4Co-00044i-Um for qemu-devel@nongnu.org; Fri, 24 May 2019 03:01:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hU4Cn-0005Gp-Ik for qemu-devel@nongnu.org; Fri, 24 May 2019 03:01:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32794) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hU4Cn-0005G5-60 for qemu-devel@nongnu.org; Fri, 24 May 2019 03:01:29 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CE6E820260 for ; Fri, 24 May 2019 07:01:27 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-101.ams2.redhat.com [10.36.116.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 036AA62516; Fri, 24 May 2019 07:01:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AD1311753B; Fri, 24 May 2019 09:01:18 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 24 May 2019 09:01:18 +0200 Message-Id: <20190524070118.30157-5-kraxel@redhat.com> In-Reply-To: <20190524070118.30157-1-kraxel@redhat.com> References: <20190524070118.30157-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 24 May 2019 07:01:27 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 4/4] egl-helpers: add modifier support to egl_dmabuf_import_texture() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Williamson , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Check and use QemuDmaBuf->modifier in egl_dmabuf_import_texture() for dmabuf imports. Signed-off-by: Gerd Hoffmann --- ui/egl-helpers.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index 0c9716067cfb..87bfd32e8ddb 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -229,20 +229,34 @@ int egl_get_fd_for_texture(uint32_t tex_id, EGLint *s= tride, EGLint *fourcc, void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf) { EGLImageKHR image =3D EGL_NO_IMAGE_KHR; - EGLint attrs[] =3D { - EGL_DMA_BUF_PLANE0_FD_EXT, dmabuf->fd, - EGL_DMA_BUF_PLANE0_PITCH_EXT, dmabuf->stride, - EGL_DMA_BUF_PLANE0_OFFSET_EXT, 0, - EGL_WIDTH, dmabuf->width, - EGL_HEIGHT, dmabuf->height, - EGL_LINUX_DRM_FOURCC_EXT, dmabuf->fourcc, - EGL_NONE, /* end of list */ - }; + EGLint attrs[64]; + int i =3D 0; =20 if (dmabuf->texture !=3D 0) { return; } =20 + attrs[i++] =3D EGL_WIDTH; + attrs[i++] =3D dmabuf->width; + attrs[i++] =3D EGL_HEIGHT; + attrs[i++] =3D dmabuf->height; + attrs[i++] =3D EGL_LINUX_DRM_FOURCC_EXT; + attrs[i++] =3D dmabuf->fourcc; + + attrs[i++] =3D EGL_DMA_BUF_PLANE0_FD_EXT; + attrs[i++] =3D dmabuf->fd; + attrs[i++] =3D EGL_DMA_BUF_PLANE0_PITCH_EXT; + attrs[i++] =3D dmabuf->stride; + attrs[i++] =3D EGL_DMA_BUF_PLANE0_OFFSET_EXT; + attrs[i++] =3D 0; + if (dmabuf->modifier) { + attrs[i++] =3D EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT; + attrs[i++] =3D (dmabuf->modifier >> 0) & 0xffffffff; + attrs[i++] =3D EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT; + attrs[i++] =3D (dmabuf->modifier >> 32) & 0xffffffff; + } + attrs[i++] =3D EGL_NONE; + image =3D eglCreateImageKHR(qemu_egl_display, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, --=20 2.18.1