From nobody Fri May 3 23:53:29 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=1559115285; cv=none; d=zoho.com; s=zohoarc; b=WoJdOa39lGEcrJGmj2w+NBOnL/JfyHq+dxbjD3FKWYJWKCm8cjgeJxKCoWV5sOxIGjEvbN80bEaLahgiIV8K34fQPjWk6lrRTWSKbQto3bHSSMVF7XY9jlvoIWjCx0kWaUdM8kl0j/TdDaaIxOSZrVTAsdlhviplgiDaYTdgTGw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559115285; 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=Ldg8zOhkrRdMzp1BBb5n2H6E3Dc+nzLWaBrL/JLFF/lobGtXJb/hVGJ2EOOxnf36dvSCb9D70zfsskuhmocLgMA5zzKARinWIE4cD6iWGAukSLwASR8MyjAflaEQIbfmXcFj0UAI0LnlZV3zwT/tQuV6YdbfuMczpL2EcV9V0jM= 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 1559115285414523.6403280647586; Wed, 29 May 2019 00:34:45 -0700 (PDT) Received: from localhost ([127.0.0.1]:49061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVt6f-0003eP-Ei for importer@patchew.org; Wed, 29 May 2019 03:34:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVsuK-00013f-RO for qemu-devel@nongnu.org; Wed, 29 May 2019 03:21:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVsuK-000504-0D for qemu-devel@nongnu.org; Wed, 29 May 2019 03:21:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57426) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVsuJ-0004zV-Rr for qemu-devel@nongnu.org; Wed, 29 May 2019 03:21:55 -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 14E18309267F for ; Wed, 29 May 2019 07:21:50 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4463C5B681; Wed, 29 May 2019 07:21:45 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 8022317446; Wed, 29 May 2019 09:21:44 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 29 May 2019 09:21:41 +0200 Message-Id: <20190529072144.26737-2-kraxel@redhat.com> In-Reply-To: <20190529072144.26737-1-kraxel@redhat.com> References: <20190529072144.26737-1-kraxel@redhat.com> MIME-Version: 1.0 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.43]); Wed, 29 May 2019 07:21:50 +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 v3 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 Fri May 3 23:53:29 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=1559114899; cv=none; d=zoho.com; s=zohoarc; b=lkk770mxMr+jp3K8WE8QiEw+EjWFPs935w2Vqo4zwEbDWpE8luNOMTzer/dAD/aNe82mypWnHTalgTENzj+Cq2SudUyU92hMVbTS8dpk5SxQR7mg5tH3M2/WHwcZ2ZXCnaanHCfbNh2w9GJlynyBY6619VYuljZ2oZp556KAMHM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559114899; 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=EUDyGlfbu+qhet2vIeeK62L2DnBSDjDB+dKNZrPUovs=; b=XiWfmq364JjMpgJnv/5uwdgfUzjB7SUjPtGhROW/a3omm1OS45NolDkewEYfNrObszCnlafeF+yXIMFhPEhR7oP7pj60tISgKUc8VCaBFD1pjhZgWokfPTdKruPRGSA4kSWhx/gkQQiejXaf+0Wt7c1Ebd9F9j4/kbWA12AVd+8= 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 155911489971131.710603774846163; Wed, 29 May 2019 00:28:19 -0700 (PDT) Received: from localhost ([127.0.0.1]:48959 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVt0R-0006Vb-Jc for importer@patchew.org; Wed, 29 May 2019 03:28:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56184) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVsuO-00016v-8E for qemu-devel@nongnu.org; Wed, 29 May 2019 03:22:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVsuN-00051c-Dc for qemu-devel@nongnu.org; Wed, 29 May 2019 03:22:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43968) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVsuM-00050t-N2 for qemu-devel@nongnu.org; Wed, 29 May 2019 03:21:59 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 525753024EB0 for ; Wed, 29 May 2019 07:21:52 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3EF2660487; Wed, 29 May 2019 07:21:45 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 87CAC17472; Wed, 29 May 2019 09:21:44 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 29 May 2019 09:21:42 +0200 Message-Id: <20190529072144.26737-3-kraxel@redhat.com> In-Reply-To: <20190529072144.26737-1-kraxel@redhat.com> References: <20190529072144.26737-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 29 May 2019 07:21:52 +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 v3 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 2c2d3e5b71d6..a5a608c5b226 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 Fri May 3 23:53:29 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=1559115843; cv=none; d=zoho.com; s=zohoarc; b=U8qpHdwHC5JoigyCp1UcyuwUbqrQUyqYuBdH2weecgu5GYy2UI3zJI22GoOytS1sUwpYvrb2BcRTobtnnW4BQDFbTmTilpbDBcMI4NINYcCLUBoAhFvfk9XnpxGROCmICKV6CHBLxtKUyB86t0qPWpTygDTOE80owtes3GTG5Fs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559115843; 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=nGbxwxeJd59XFk1y0XOU1KEO2Pojp/bHIS7BYFZsagq9pAc7fce5fIJN9FzY8rDJ/+VnVNOS92hLmcPV1wW1OQPQn7ze/gV8PUem8dxKHmBF2djOrzUEyh1utEyvcgVRWgh5d7qcLfiLFPTQ47wKty6eBzBmWdkpBbzFpcei+CM= 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 1559115843033842.7370964879163; Wed, 29 May 2019 00:44:03 -0700 (PDT) Received: from localhost ([127.0.0.1]:49220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVtFW-0002dM-0W for importer@patchew.org; Wed, 29 May 2019 03:43:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVsuJ-00012M-II for qemu-devel@nongnu.org; Wed, 29 May 2019 03:21:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVsuH-0004yu-M3 for qemu-devel@nongnu.org; Wed, 29 May 2019 03:21:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51034) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVsuH-0004yK-9b for qemu-devel@nongnu.org; Wed, 29 May 2019 03:21:53 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4421230C1217 for ; Wed, 29 May 2019 07:21:52 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4171C60BDF; Wed, 29 May 2019 07:21:45 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9244A17512; Wed, 29 May 2019 09:21:44 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 29 May 2019 09:21:43 +0200 Message-Id: <20190529072144.26737-4-kraxel@redhat.com> In-Reply-To: <20190529072144.26737-1-kraxel@redhat.com> References: <20190529072144.26737-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 29 May 2019 07:21:52 +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 v3 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 Fri May 3 23:53:29 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=1559114741; cv=none; d=zoho.com; s=zohoarc; b=dE9wYzpYzCHn3qpSbBFAIuAbI4TuBGrjITXOWLyVLMrzFAUEsOmF2by5KiXCJUUHQMFdOVQ9fbjlcilRzJkQTu3B6TlMpiy2QMJXu33uH7uGUAr/ux4aseGVdCAMUdyRVGnRZ2IOQyp1Q1cPWiIDRR2nVm/C5YfGZgTYEiY95Ys= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559114741; 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=Hkj4P28kwlwI2LTa8P1tBUptAUswhOShADdKda3BL+Y=; b=LkOobltIiOoc98LGSUudN+mzZiodFFlfibcIFz86MGQiJgA7AIcFumLsN3k0Ny98jdPiiunVrMqTrqXIcjOuu+V7gVMlPnM2enmHB7txp0hX//Bdvtml5kSR0bLIR+wKrIoOqK9gbqZSx7f2Dpr/YimO96yRxR5OUm70NHtk0A8= 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 1559114741037264.4181059066626; Wed, 29 May 2019 00:25:41 -0700 (PDT) Received: from localhost ([127.0.0.1]:48905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVsxp-0003gt-Sv for importer@patchew.org; Wed, 29 May 2019 03:25:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVsuH-00010d-IJ for qemu-devel@nongnu.org; Wed, 29 May 2019 03:21:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVsuG-0004y3-33 for qemu-devel@nongnu.org; Wed, 29 May 2019 03:21:53 -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 1hVsuF-0004xG-V1 for qemu-devel@nongnu.org; Wed, 29 May 2019 03:21:52 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CA44B9D43B for ; Wed, 29 May 2019 07:21:49 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4753E5D9D6; Wed, 29 May 2019 07:21:45 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 99FC417524; Wed, 29 May 2019 09:21:44 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 29 May 2019 09:21:44 +0200 Message-Id: <20190529072144.26737-5-kraxel@redhat.com> In-Reply-To: <20190529072144.26737-1-kraxel@redhat.com> References: <20190529072144.26737-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 29 May 2019 07:21:49 +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 v3 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 | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index 0c9716067cfb..edc53f6d3464 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -229,20 +229,36 @@ 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; +#ifdef EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT + 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; + } +#endif + attrs[i++] =3D EGL_NONE; + image =3D eglCreateImageKHR(qemu_egl_display, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, --=20 2.18.1