Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp398200imm; Fri, 3 Aug 2018 05:26:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdq/y6iKG87NO3YgECVdp5EJKUBpt6i6CeVEiDQqKwi6Nw32jgcKUJ/ruRt/7NERUHDeCva X-Received: by 2002:a17:902:59da:: with SMTP id d26-v6mr3422923plj.42.1533299189947; Fri, 03 Aug 2018 05:26:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533299189; cv=none; d=google.com; s=arc-20160816; b=y2TihGCB4tTHeripdjeI6kl1hV/5ZPxiYXG8e3BKY4ytA5qKeKXVswMq7HHMhLV5Vy MTLrfB4HCkeM3RtLEBhsxHwocGGvm1hcfD/s/cFcMU5AcrQKhV0X23dS7M1v1FDH8Xcs jdKdVdFyLIybGH3VFGFkmcgNWs3QP7VhNrtPLNQiuzOsQT+/sW7TlGlR883af3TbE4s9 IOqUjv59DaYFTOhiVtXTxEh+uQqL10ESuyIcppXwEojksPFTMxly47NheMF4EB47ErNY G3rJXrnm6L9GDmCTuPIyfHqsk1QudVzUEbWaQReW29+X5co8+BigdiYntmTt6t/k5kG2 r6zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=XuLan1+ws482brESSvG7ZrrRm1JYBisurpGscsrLpuo=; b=pV3sqt8lhrDkXUpfa/a0UgzC/dzqjpRCMwvJuHawtN1mQr+6YlMndoydldPCtmzvJ5 vkHupg4b/D/Ar/3fr+W9lMQ2+NyMmB1pTlcBqBXvSExLCXkEtM4b7iGIuahNTFyAWobb lqKMR3tW/Ai3Bx1/UdSEQLQGQQuPg+fRnZ4jze0XBPIJk4BhSHTZVSDjcRzp4UoCoKQg 2WouFgqglrc2yRImIJCp9tAHpOvBe2itWqAsAqWbPn+i2bFw1uHF8A/vmXHKHSh9DLpK S/WuxxQwDeO9sr9tridqZeB5DNKzmHkdM7gRohCtZJdVGjO/PZYDZsHYiPWR8OSQ7ptE syAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PqDJxrGH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1-v6si4108925pge.521.2018.08.03.05.26.15; Fri, 03 Aug 2018 05:26:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PqDJxrGH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728742AbeHCOV1 (ORCPT + 99 others); Fri, 3 Aug 2018 10:21:27 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:39745 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727540AbeHCOV1 (ORCPT ); Fri, 3 Aug 2018 10:21:27 -0400 Received: by mail-wr1-f66.google.com with SMTP id h10-v6so5246870wre.6 for ; Fri, 03 Aug 2018 05:25:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XuLan1+ws482brESSvG7ZrrRm1JYBisurpGscsrLpuo=; b=PqDJxrGHQmx7bohffki4fiHEBwFKbEa1T+4Du7KB7TAt5oH5QKf/PQvOwbbLWRGDl+ t+6+lJlkAUC/hGx4EQAqvQwZ0i2Spb+oLd548frpxkH42/2s8I8I4YQGns1Z3lFZxVx+ 4nwRfgHHzUw7SM2/D1o69mQa/58VUnw2Vw+uEQuSygVkIuY33UBHaTgaC5E/CqRLmPIb qO0A/hnaS7zSHIQJngMOOsMEvz85VIYq4pJSM0UOBOwxfbCLDVA66toKzoB37egZer+W yDr0/0prJnt/9Z5yJssVAFuxNbP5ROMpLTf+crn2Jutw5iC+U/PNG74mHYLynJczHy1m +IkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XuLan1+ws482brESSvG7ZrrRm1JYBisurpGscsrLpuo=; b=PBQyBj3vQ83siT4g/vGuthb7SF0NfvFA2KrkjjBkl3GQFuuyM+JL6BoqI/XPrW0KHh fxRxzs46JbSm22bRYQSK1zG2U10b17YFDZP1DmEoaAQCXpJtmLyJRXiIoDc6cFsfFDLE tWND4FRjO6LQEoo4hmw8ngYQ+e1MsIMjWActdWX+EzXrzmJA+I+9i8Pq4371MDgcvZmC idldp4Shew7t3Q5gM+aulJCCLK0Cw+Iax0MW8jrOwacAF8W57B+espdfr1YB58CCpwfR bx5K88WH3RCTUzCQeE27jCd+7LdDXmAXDBEiiMaNHO0QWD3uGhYQeJe1wzrPh0cEbdQ0 wfBw== X-Gm-Message-State: AOUpUlF4TcS1xvA4TMSdu1+rwqFihdNxLbcYd1pgHqm3F/7gf0QA4kRv MFRZiXSuNE0qsY7MIdreQn+QpNp2VeFa7VgZ/Jw= X-Received: by 2002:adf:eac8:: with SMTP id o8-v6mr2293150wrn.150.1533299119844; Fri, 03 Aug 2018 05:25:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1c:178a:0:0:0:0:0 with HTTP; Fri, 3 Aug 2018 05:25:19 -0700 (PDT) In-Reply-To: <20180724082213.25677-1-robert.foss@collabora.com> References: <20180724082213.25677-1-robert.foss@collabora.com> From: Emil Velikov Date: Fri, 3 Aug 2018 13:25:19 +0100 Message-ID: Subject: Re: [RFC] drm: Allow DRM_IOCTL_MODE_MAP_DUMB for render nodes To: Robert Foss Cc: Gustavo Padovan , Maarten Lankhorst , Sean Paul , David Airlie , ML dri-devel , "Linux-Kernel@Vger. Kernel. Org" , Tomasz Figa , Rob Herring , Eric Engestrom , Brian Paul , Tomeu Vizoso , Nicolas Norvez Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, Sharing some ideas on the topic. Personally I'm neither for, nor against this patch. On 24 July 2018 at 09:22, Robert Foss wrote: > From: Tomasz Figa > > There is no particular reason to prevent userspace for using this IOCTL, > considering that it already has access to other, platform-specific > IOCTLs. This patch makes is possible to have the same userspace code > work regardless on the underlying platform, which significantly > simplifies the stack. > > Signed-off-by: Tomasz Figa > Reviewed-by: Zach Reizner > Signed-off-by: Nicolas Norvez > Reviewed-by: Tomasz Figa > Signed-off-by: Robert Foss > --- > > I've been looking into enabling a kms_swrast based driver for mesa on > the Android platform[1]. > > But have come up against the issue of dumb buffer related ioctls below > not being flagged with DRM_RENDER_ALLOW. > > DRM_IOCTL_MODE_CREATE_DUMB > DRM_IOCTL_MODE_MAP_DUMB > > To be more precise, I've been seeing a failure due to DRM_IOCTL_MODE_MAP_DUMB > not being allowed for /dev/dri/renderD* nodes, and used in mesa > kms_sw_displaytarget_map(). > > > As I understand it the DRM_RENDER_ALLOW flag being unset is a very intentional > restriction placed on dumb buffers in order to minimize its use. > But as far as alternative solutions for software renderers there seems to only > be VGEM and mmap()-ing DMABUFs. > > While it would be convenient from the point of view of software renderers if > dumb buffers had more promiscuous permissions, it may be a hard sell upstream. > > If dumb buffers aren't the way forward, what is? VGEM? Or are there any other > preferable ways? > The description of VGEM says "... as used by Mesa's software renderer for enhanced performance." Although that hasn't been the case really, since we're opening an arbitrary GPU node with kms_swrast. I think we should fix that. On top of that we could also use the card node, which will remove the need for this patch. Yet again, there may be reasonable usecases where one needs the render node to support the dumb buffer ioctls. HTH Emil