From owner-freebsd-x11@freebsd.org Mon Apr 20 19:25:50 2020 Return-Path: Delivered-To: freebsd-x11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F5BD2AC275 for ; Mon, 20 Apr 2020 19:25:50 +0000 (UTC) (envelope-from tomek@cedro.info) Received: from mail-oi1-x243.google.com (mail-oi1-x243.google.com [IPv6:2607:f8b0:4864:20::243]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 495c9n4p0Mz3Qrc for ; Mon, 20 Apr 2020 19:25:49 +0000 (UTC) (envelope-from tomek@cedro.info) Received: by mail-oi1-x243.google.com with SMTP id k133so9855715oih.12 for ; Mon, 20 Apr 2020 12:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cedro.info; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Msad3AxK1JG6YID7otx0brSwDOsLSBRCiW4X6LM5r7M=; b=iP3GQla6VG4twvbD59dcz/SXjdU9Da+M8LP8qqtB8iDm/KZumAtXZ4XJxpYqIClrfM jigbtaUiehfZklTDN4AtYh+VDPB0icFDcgqRJMPEKCEgaq5bd/io6YuJLWVAPTtQY7dB njIkIShJcgwOcJHu0UXtFUC5byw894n3ouufi4tEyirAezD7d5pTUf81NTytFy98pKkU wD4lAvsA/ZiNSqNs+ZGwhAG8dYxPmTcDMXPhJwOBaahrqzYMdgZep9sww4xLZEt+y7DR 4JnXFTPu8n8G8Nq1y6SVlSt1McMrXBs7JujU1DL2m3mZ6P+gd4VEht6Da3jk9ZGdHPHa ZGMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Msad3AxK1JG6YID7otx0brSwDOsLSBRCiW4X6LM5r7M=; b=NiN4IRexWNYOJpFdGs/G6LrBSnzM5do807T2cWcXjdrAyRAm5PMy9C2BJO/4SLJUKq NSh7nq9P+2Z7/qqT23lsifROaLtxUJQrkDRPqs7owuMvgGXWhhdYOl0CcLugZHf/oQFW UXEdTFqZD9pu2TG7vqHsD8kXBkjLwrQXhLmNsHulf2t9iaBP6cN5sKKMCsUCFPgWUPeU uyxMIovVjfap0uAkeDnL7oz9LbBRiJV+qMllTTPdRT5h8TwxoRf5AYgRkjVZc+f2kTDu AlmxcENuY3EhN6xjUdoRWmKXG88NHSIU3cyJpzpO51Scc/M+SYWdjSdR3XkASpWoBRvM nfFw== X-Gm-Message-State: AGi0PuYU+GrrJjebV1KYACsjTTrsI+0cWCBSn1SiLDUKXAH7VtWRGsYj ekBU35/ojNyXajuK7jymQpzQAQ== X-Google-Smtp-Source: APiQypLws0TJOvpVvPmzb8jXoUqPWaiBgiJxiJAjTnWUJ1C3DnBJK4W9OM92En6JpEWn6fIViAghVw== X-Received: by 2002:aca:a857:: with SMTP id r84mr720184oie.69.1587410748635; Mon, 20 Apr 2020 12:25:48 -0700 (PDT) Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com. [209.85.167.172]) by smtp.gmail.com with ESMTPSA id t4sm84135oih.6.2020.04.20.12.25.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Apr 2020 12:25:48 -0700 (PDT) Received: by mail-oi1-f172.google.com with SMTP id q204so9825352oia.13; Mon, 20 Apr 2020 12:25:47 -0700 (PDT) X-Received: by 2002:a05:6808:485:: with SMTP id z5mr716844oid.78.1587410747535; Mon, 20 Apr 2020 12:25:47 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Tomasz CEDRO Date: Mon, 20 Apr 2020 21:25:16 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Wayland on FreeBSD To: Greg V Cc: FreeBSD Questions Mailing List , freebsd-x11@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 495c9n4p0Mz3Qrc X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cedro.info header.s=google header.b=iP3GQla6; dmarc=none; spf=none (mx1.freebsd.org: domain of tomek@cedro.info has no SPF policy when checking 2607:f8b0:4864:20::243) smtp.mailfrom=tomek@cedro.info X-Spamd-Result: default: False [-2.44 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[cedro.info:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-x11@freebsd.org]; DMARC_NA(0.00)[cedro.info]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[cedro.info:+]; RCVD_IN_DNSWL_NONE(0.00)[3.4.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-0.14)[ip: (0.11), ipnet: 2607:f8b0::/32(-0.33), asn: 15169(-0.43), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2020 19:25:50 -0000 On Mon, Apr 20, 2020 at 11:59 AM Greg V wrote: > There are no "Linux specific DMA transfers" in userspace applications :) = DMA-BUF is basically a way to refer to GPU buffers from userspace, pass the= m around as file descriptors, and synchronize access to them. Of course it = is supported, it's a very important part of the DRM stack. Hmm, is it then normal to use on non-Linux code like this? #include #include "linux-dmabuf-unstable-v1-client-protocol.h" struct zwp_linux_dmabuf_v1 *dmabuf; struct zwp_linux_buffer_params_v1 *dp; dmabuf =3D ecore_wl2_display_dmabuf_get(ewd); dp =3D zwp_linux_dmabuf_v1_create_params(dmabuf); zwp_linux_buffer_params_v1_add(dp, db->fd, 0, 0, db->stride, 0, 0); buf =3D zwp_linux_buffer_params_v1_create_immed(dp, db->w, db->h, format, flags); wl_buffer_add_listener(buf, &buffer_listener, db); zwp_linux_buffer_params_v1_destroy(dp); static void _create_succeeded(void *data EINA_UNUSED, struct zwp_linux_buffer_params_v1 *params, struct wl_buffer *new_buffer) { wl_buffer_destroy(new_buffer); zwp_linux_buffer_params_v1_destroy(params); } zwp_linux_buffer_params_v1_destroy(params); struct zwp_linux_buffer_params_v1 *dp; dp =3D zwp_linux_dmabuf_v1_create_params(ewd->wl.dmabuf); zwp_linux_buffer_params_v1_add(dp, buf->fd, 0, 0, buf->stride, 0, 0); zwp_linux_buffer_params_v1_add_listener(dp, ¶ms_listener, ewd); zwp_linux_buffer_params_v1_create(dp, buf->w, buf->h, DRM_FORMAT_ARGB8888, 0); Is this some sort of Linux KMS/DRM specification that keeps explict "linux" name hardcoded and we have them too on FreeBSD named that way? Never seen anything like this :-) > Nothing currently installs the uapi header that contain= s some definitions for the sync ioctl, but the ioctl works: > https://github.com/FreeBSDDesktop/kms-drm/blob/drm-v4.16/linuxkpi/gplv2/s= rc/linux_dmabuf.c > > Chromium currently patches ifdefs to use the inlined copy of the header t= hat's already there for older Linux installations: > https://github.com/freebsd/freebsd-ports/blob/master/www/chromium/files/p= atch-ui_gfx_linux_client__native__pixmap__dmabuf.cc > https://chromium.googlesource.com/chromium/src/+/refs/tags/84.0.4120.1/ui= /gfx/linux/client_native_pixmap_dmabuf.cc > > But really we need a tiny port that installs that header already :) Will look into this in a free moment and report back! Does this mean we only put that header and things start workin? ;-) Thank you Greg!! :-) --=20 CeDeROM, SQ7MHZ, http://www.tomek.cedro.info