From nobody Mon Nov 10 22:28:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.47 as permitted sender) client-ip=209.51.188.47; 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.47 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=1559913741; cv=none; d=zoho.com; s=zohoarc; b=SxpxPuLcmjA9DE1dMzrGIbbvF2KIEzWHAk2FZeoRB9t43srMSAIub3pYFf8Y1VrrHJhIoSV/2CDhC8YOylEx3M+eAKMFva8j326IN8PY653urajcv31YzKct+HfvnSyBWXchqGFkuFPZPuB6JS++zfweJOQf1uPIgNjBkx0Ri2I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559913741; 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=1A1hML7Zj+w4fqhn7d9ECiJ/Y6kEP7PacIp0srtrl1Y=; b=RBKxnrDrcB86neCDEXgccR6oYaT2etvEgRsSz8CSndsB1+5mEaB5omUNHFbl06uzCl7PYddHlANTqOLsEHUTBB6N/YxuGBJQjCbrq+DnAAhMJCsTNDtQ6T4j3ocCZz3tcqvf5/7gghyjWjEt8S74FAkEkOcEivlTPmplzylWsXY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.47 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.47 [209.51.188.47]) by mx.zohomail.com with SMTPS id 1559913741183868.5891548406602; Fri, 7 Jun 2019 06:22:21 -0700 (PDT) Received: from localhost ([::1]:51066 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEoy-0000uo-Om for importer@patchew.org; Fri, 07 Jun 2019 09:22:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34445) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEm3-0007Oj-RQ for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZEm2-0005GE-LY for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14168) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hZEm2-0005CK-Cw for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:14 -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 B2F716EB97 for ; Fri, 7 Jun 2019 13:19:08 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-25.ams2.redhat.com [10.36.117.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61A347FE99; Fri, 7 Jun 2019 13:19:03 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 00D3E17532; Fri, 7 Jun 2019 15:19:02 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 7 Jun 2019 15:18:57 +0200 Message-Id: <20190607131901.20107-2-kraxel@redhat.com> In-Reply-To: <20190607131901.20107-1-kraxel@redhat.com> References: <20190607131901.20107-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.25]); Fri, 07 Jun 2019 13:19:08 +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] [PULL 1/5] ui/curses: Fix build with -m32 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Williamson , Gerd Hoffmann , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Max Reitz wchar_t may resolve to be an unsigned long on 32-bit architectures. Using the %x conversion specifier will then give a compiler warning: ui/curses.c: In function =E2=80=98get_ucs=E2=80=99: ui/curses.c:492:49: error: format =E2=80=98%x=E2=80=99 expects argument of = type =E2=80=98unsigned int=E2=80=99, but argument 3 has type =E2=80=98wchar= _t=E2=80=99 {aka =E2=80=98long int=E2=80=99} [-Werror=3Dformat=3D] 492 | fprintf(stderr, "Could not convert 0x%04x " | ~~~^ | | | unsigned int | %04lx 493 | "from wchar_t to a multibyte character: %s\= n", 494 | wch, strerror(errno)); | ~~~ | | | wchar_t {aka long int} ui/curses.c:504:49: error: format =E2=80=98%x=E2=80=99 expects argument of = type =E2=80=98unsigned int=E2=80=99, but argument 3 has type =E2=80=98wchar= _t=E2=80=99 {aka =E2=80=98long int=E2=80=99} [-Werror=3Dformat=3D] 504 | fprintf(stderr, "Could not convert 0x%04x " | ~~~^ | | | unsigned int | %04lx 505 | "from a multibyte character to UCS-2 : %s\n= ", 506 | wch, strerror(errno)); | ~~~ | | | wchar_t {aka long int} Fix this by casting the wchar_t value to an unsigned long and using %lx as the conversion specifier. Fixes: b7b664a4fe9a955338f2e11a0f7433b29c8cbad0 Signed-off-by: Max Reitz Reviewed-by: Samuel Thibault Message-id: 20190527142540.23255-1-mreitz@redhat.com Signed-off-by: Gerd Hoffmann --- ui/curses.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/curses.c b/ui/curses.c index 1f3fcabb004b..e9319eb8ae19 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -489,9 +489,9 @@ static uint16_t get_ucs(wchar_t wch, iconv_t conv) memset(&ps, 0, sizeof(ps)); ret =3D wcrtomb(mbch, wch, &ps); if (ret =3D=3D -1) { - fprintf(stderr, "Could not convert 0x%04x " + fprintf(stderr, "Could not convert 0x%04lx " "from wchar_t to a multibyte character: %s\n", - wch, strerror(errno)); + (unsigned long)wch, strerror(errno)); return 0xFFFD; } =20 @@ -501,9 +501,9 @@ static uint16_t get_ucs(wchar_t wch, iconv_t conv) such =3D sizeof(uch); =20 if (iconv(conv, &pmbch, &smbch, &puch, &such) =3D=3D (size_t) -1) { - fprintf(stderr, "Could not convert 0x%04x " + fprintf(stderr, "Could not convert 0x%04lx " "from a multibyte character to UCS-2 : %s\n", - wch, strerror(errno)); + (unsigned long)wch, strerror(errno)); return 0xFFFD; } =20 --=20 2.18.1 From nobody Mon Nov 10 22:28:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.47 as permitted sender) client-ip=209.51.188.47; 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.47 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=1559913884; cv=none; d=zoho.com; s=zohoarc; b=Dod46KgDrnO9eXhzXUXX5HbOJlE1hCXBmckoYymBfH/hhWwPhZOfohbuzuI4AQWJ5tO8F5dbmcgrMkWFNh8Jk4Zwh9dYD+UnkP0xBeP5fnD4VOaKCDhIu6osqmcJvK1m9Ztzhi4DEE02Nbyk62Ihe8ONcBv16HCr25+z1sXCfIA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559913884; 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=+ere5ddZ1aBVKGD24JN7CaBh6Bg5ekEjbbdQeNvYiuM=; b=ZIQYdj7HjJiGe2DXHCV7Q0KI+IF+Eue2QHKZ28LwK3th9ctluboflbpwJi4u0H9U99oNRipZbX+RF3HIxkvcyBedr52dt++9xV7Kd3k3rQkzUAKwRz5wabJ9cE3XQyFeFmeL0zrXn27rGodSZLTuNyKL1ObHGJO3KZOatBdrn9E= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.47 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.47]) by mx.zohomail.com with SMTPS id 1559913884086520.2663920715979; Fri, 7 Jun 2019 06:24:44 -0700 (PDT) Received: from localhost ([::1]:51098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZErL-000435-4n for importer@patchew.org; Fri, 07 Jun 2019 09:24:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34462) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEm5-0007R2-4G for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZEm4-0005R3-4D for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58198) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hZEm3-0005KK-U7 for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:16 -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 409E1CA36F for ; Fri, 7 Jun 2019 13:19:10 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-25.ams2.redhat.com [10.36.117.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id E17F97DDF9; Fri, 7 Jun 2019 13:19:07 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 08F0F17534; Fri, 7 Jun 2019 15:19:02 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 7 Jun 2019 15:18:58 +0200 Message-Id: <20190607131901.20107-3-kraxel@redhat.com> In-Reply-To: <20190607131901.20107-1-kraxel@redhat.com> References: <20190607131901.20107-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.38]); Fri, 07 Jun 2019 13:19:10 +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] [PULL 2/5] console: add dmabuf modifier field. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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 Message-id: 20190529072144.26737-2-kraxel@redhat.com --- 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 Mon Nov 10 22:28:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.47 as permitted sender) client-ip=209.51.188.47; 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.47 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=1559913740; cv=none; d=zoho.com; s=zohoarc; b=WPZTFe1UKk4fqbZZs19MhJehqZamq8L4lmPae92cmQwQaCqULG8RO/tiwyAWNoywBdGbnOiW94pcSnm6DTJ8P6afUfO3aNM3ouSdmSuiCV+mGnmuaoN8aykuVmNZHXGpPlo5+HZyDxum6ILSfyJp3lHXqJE0Hf73lus2ZCXv6hc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559913740; 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=6dQi8cEkEYtF5AOLfjbXVj9AEK8TWfy0j29CbJjLIaE=; b=nhq5GqyIcuCxfUYI/9jEZwyzeu+fsW+ouxEP+PES30veRTVzTF4nZ9cPFl52863N6zi6X6NHgnX+NbSfaFSe433F+8DMgjOpSlNTtZyvrpXklnysFpduzkMd6JdDUbh2t/opBP8fh5K8AFFQRVTnrirwQptCkBNLamxnAgawueA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.47 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.47 [209.51.188.47]) by mx.zohomail.com with SMTPS id 1559913740710586.8220741334646; Fri, 7 Jun 2019 06:22:20 -0700 (PDT) Received: from localhost ([::1]:51064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEow-0000o7-Ea for importer@patchew.org; Fri, 07 Jun 2019 09:22:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34428) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEm3-0007Nt-1o for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZEm2-0005Dk-3f for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49698) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hZEm1-00057h-Te for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:14 -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 1EF0D3082145 for ; Fri, 7 Jun 2019 13:19:08 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-25.ams2.redhat.com [10.36.117.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61B0A68C71; Fri, 7 Jun 2019 13:19:03 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 10D7117535; Fri, 7 Jun 2019 15:19:02 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 7 Jun 2019 15:18:59 +0200 Message-Id: <20190607131901.20107-4-kraxel@redhat.com> In-Reply-To: <20190607131901.20107-1-kraxel@redhat.com> References: <20190607131901.20107-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.42]); Fri, 07 Jun 2019 13:19:08 +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] [PULL 3/5] vfio/display: set dmabuf modifier field X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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 Message-id: 20190529072144.26737-3-kraxel@redhat.com --- 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 Mon Nov 10 22:28:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.47 as permitted sender) client-ip=209.51.188.47; 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.47 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=1559913740; cv=none; d=zoho.com; s=zohoarc; b=jjirBGBEy2WIQtz0fx3+An2t2xMCjHMrP+pNmsO9ZNpxWAsb6dRaYfnCjcB02gYZtrO/9f7g15R9dWW6p4kJECVwmzCcrnHgidvsNSQEEjAbXlCBNi5Ms2cdVhR9JFEEL/HjoKAA3SMlB/cd9PbplTbfsQ4R781deNB34W0surA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559913740; 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=QZ2RTe+uTH91TvE9WiMqx0HpSzx+ZViBVQ5430O1LfU=; b=L+/2fxrZmimdPCavPHicCSdYn2bm26YG2AsuN9UosBGJtBBFJCp0z2jz9NXdRPIp+sdk+ZDPymoZhatAf+pFpYQaFhBsMXh7KORaRNhpwgfcLQPxpv/GQdHeNhJl05PNU0hk9Ftgq9ty/yZvYU8vje47shLLJ0XvwWtQn2Oc+Mg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.47 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.47 [209.51.188.47]) by mx.zohomail.com with SMTPS id 1559913740697297.0103863205147; Fri, 7 Jun 2019 06:22:20 -0700 (PDT) Received: from localhost ([::1]:51052 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEot-0000eG-Kh for importer@patchew.org; Fri, 07 Jun 2019 09:22:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34407) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEm1-0007ND-0F for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZElz-00051W-Sr for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51102) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hZElz-0004uZ-Kw for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:11 -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 64E3A3084213 for ; Fri, 7 Jun 2019 13:19:10 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-25.ams2.redhat.com [10.36.117.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6634D7DE35; Fri, 7 Jun 2019 13:19:03 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1B78917536; Fri, 7 Jun 2019 15:19:02 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 7 Jun 2019 15:19:00 +0200 Message-Id: <20190607131901.20107-5-kraxel@redhat.com> In-Reply-To: <20190607131901.20107-1-kraxel@redhat.com> References: <20190607131901.20107-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.40]); Fri, 07 Jun 2019 13:19:10 +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] [PULL 4/5] egl-helpers: add modifier support to egl_get_fd_for_texture(). X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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 Message-id: 20190529072144.26737-4-kraxel@redhat.com --- 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 Mon Nov 10 22:28:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.47 as permitted sender) client-ip=209.51.188.47; 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.47 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=1559913889; cv=none; d=zoho.com; s=zohoarc; b=hrINGl4REyacsOsnhfTvjhEs+OYsdtCAM5ZbHvMWq88wBfDu0EUX5sFZ/0f0Hlf7l1Drd7HWDPhj1ZelSZ3YtNlK3pXICuedizW2oaizjT7BA2qeS6hmKJjcMoQ1NwoR63mLmyl8zuWWEdcOx38TGqbsVJOQf4OnwWLUKpdTA38= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559913889; 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=etpXcIwF3znjVI8Q5/rh2i79ZRMbO6F4VUry/GyH7eQ=; b=ZN4Pv3mRNrikDJLdvrN2U2EuBvcTrVBS8BrpbpeXth/XS8muNgPHnFKM6cd3s4GXTQ+NnnR/fAcACzjbxaCbrTzq6v8a6W7iqI6r8mHoaxGmTRwNxdDJEIMwcCqU/LVy/RyvfUA2Hcfm9aCIO9p6l/eOpDBBr9yKsnCf4ymEHdM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.47 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.47]) by mx.zohomail.com with SMTPS id 1559913889429471.64489990605944; Fri, 7 Jun 2019 06:24:49 -0700 (PDT) Received: from localhost ([::1]:51096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZErH-0003vg-Qb for importer@patchew.org; Fri, 07 Jun 2019 09:24:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34486) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZEm6-0007UL-Et for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZEm5-0005WW-FQ for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41296) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hZEm5-0005Te-A7 for qemu-devel@nongnu.org; Fri, 07 Jun 2019 09:19:17 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9B6BC6EB99 for ; Fri, 7 Jun 2019 13:19:11 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-25.ams2.redhat.com [10.36.117.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEE221001B0C; Fri, 7 Jun 2019 13:19:08 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2396A17538; Fri, 7 Jun 2019 15:19:02 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 7 Jun 2019 15:19:01 +0200 Message-Id: <20190607131901.20107-6-kraxel@redhat.com> In-Reply-To: <20190607131901.20107-1-kraxel@redhat.com> References: <20190607131901.20107-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 07 Jun 2019 13:19:11 +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] [PULL 5/5] egl-helpers: add modifier support to egl_dmabuf_import_texture() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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 Message-id: 20190529072144.26737-5-kraxel@redhat.com --- 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