From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45D47C021B2 for ; Thu, 20 Feb 2025 10:53:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1dtYoAqAgz9kAU35ZP38Rq1qq3hMyjZM2KrTK3fx5xw=; b=E313U3pNlffMw3 beAgYIuX/uFlNS99bAVk31i6S0Sf+iyfRzvOthhVZ9viUtF/pJf/HMeppiY2Fc7l32HTPJxkgIVH+ OEvlpl7lNniD6yUusn6x3BpP3yiCn8yzICLvS/qDYOJcGCML0RzsbMO5pdZX1jFoikxKpQ82PhB5p 37CYUVw//HVB+1tuY2wSSDeS1uhLeiA+U71Qbs8kO110ca3xd6RYZ1F42aTlncZgwum84O8mRAGc5 5wexbsBQ9XVctniMjJCrg3Zv7coGbieP9ksWW4J0j3KLoeC6LxhEKkgoWSm3A/io3PoOvgUfzk477 e7l6hDcAqZj5/T7AGroQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tl4B8-00000000OSs-1E7w; Thu, 20 Feb 2025 10:53:14 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tl4B4-00000000OQV-2nej; Thu, 20 Feb 2025 10:53:12 +0000 Received: from [192.168.88.20] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C69249FC; Thu, 20 Feb 2025 11:51:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1740048703; bh=cGmqrMQrzQNKvOYoVbXWr6Lo7FskS49XuKpEvHODBjA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=wF6C4CGDoP+/HkpCLJaEAJQ5SUDGi9n0fFlEojmHm56G4KxPszUsR/q+aXtSRtihR AQoXwkJ+zXwR8f+vg71cO6pL6HL787yGlQcQZD3c6z5sRdwltXCONK8mS2/SPW2eEM lzKYZgKG0aXbNUjO1esnvXLsAJsX44MVKluFgT40= Message-ID: <596b960e-71f8-4c2c-9abe-058206df1dfb@ideasonboard.com> Date: Thu, 20 Feb 2025 12:53:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 02/25] drm/dumb-buffers: Provide helper to set pitch and size To: Thomas Zimmermann , maarten.lankhorst@linux.intel.com, mripard@kernel.org, airlied@gmail.com, simona@ffwll.ch Cc: dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, linux-samsung-soc@vger.kernel.org, nouveau@lists.freedesktop.org, virtualization@lists.linux.dev, spice-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, Laurent Pinchart References: <20250218142542.438557-1-tzimmermann@suse.de> <20250218142542.438557-3-tzimmermann@suse.de> <355ed315-61fa-4a9d-b72b-8d5bc7b5a16c@suse.de> Content-Language: en-US From: Tomi Valkeinen Autocrypt: addr=tomi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aX16DG22c6flkkBSjyWXYepFtHz9KsBS0DaZb 4IkLmZwEXpZcIOQjQ71fqlpiXkXSIaQ6YMEs8WjBbpP81h7QxWIfWtp+VnwNGc6nq5IQDESH mvQcsFS7d3eGVI6eyjCFdcAO8eMAEQEAAcLBXwQYAQIACQUCTqazRwIbDAAKCRD6PaqMvJYe 9fA7EACS6exUedsBKmt4pT7nqXBcRsqm6YzT6DeCM8PWMTeaVGHiR4TnNFiT3otD5UpYQI7S suYxoTdHrrrBzdlKe5rUWpzoZkVK6p0s9OIvGzLT0lrb0HC9iNDWT3JgpYDnk4Z2mFi6tTbq xKMtpVFRA6FjviGDRsfkfoURZI51nf2RSAk/A8BEDDZ7lgJHskYoklSpwyrXhkp9FHGMaYII m9EKuUTX9JPDG2FTthCBrdsgWYPdJQvM+zscq09vFMQ9Fykbx5N8z/oFEUy3ACyPqW2oyfvU CH5WDpWBG0s5BALp1gBJPytIAd/pY/5ZdNoi0Cx3+Z7jaBFEyYJdWy1hGddpkgnMjyOfLI7B CFrdecTZbR5upjNSDvQ7RG85SnpYJTIin+SAUazAeA2nS6gTZzumgtdw8XmVXZwdBfF+ICof 92UkbYcYNbzWO/GHgsNT1WnM4sa9lwCSWH8Fw1o/3bX1VVPEsnESOfxkNdu+gAF5S6+I6n3a ueeIlwJl5CpT5l8RpoZXEOVtXYn8zzOJ7oGZYINRV9Pf8qKGLf3Dft7zKBP832I3PQjeok7F yjt+9S+KgSFSHP3Pa4E7lsSdWhSlHYNdG/czhoUkSCN09C0rEK93wxACx3vtxPLjXu6RptBw 3dRq7n+mQChEB1am0BueV1JZaBboIL0AGlSJkm23kw== In-Reply-To: <355ed315-61fa-4a9d-b72b-8d5bc7b5a16c@suse.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250220_025310_860930_8988D9D2 X-CRM114-Status: GOOD ( 24.74 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Hi, On 20/02/2025 12:05, Thomas Zimmermann wrote: > Hi > > Am 20.02.25 um 10:18 schrieb Tomi Valkeinen: > [...] >>> + * Color modes of 10, 12, 15, 30 and 64 are only supported for use by >>> + * legacy user space. Please don't use them in new code. Other modes >>> + * are not support. >>> + * >>> + * Do not attempt to allocate anything but linear framebuffer memory >>> + * with single-plane RGB data. Allocation of other framebuffer >>> + * layouts requires dedicated ioctls in the respective DRM driver. >> >> According to this, every driver that supports, say, NV12, should >> implement their own custom ioctl to do the exact same thing? And, of >> course, every userspace app that uses, say, NV12, should then add code >> for all these platforms to call the custom ioctls? > > Yes, that's exactly the current status. > > There has been discussion about a new dumb-create ioctl that takes a DRM > format as parameter. I'm all for it, but it's out of the scope for this > series. > >> >> As libdrm's modetest currently supports YUV formats with dumb buffers, >> should we remove that code, as it's not correct and I'm sure people >> use libdrm code as a reference? > > Of course not. > >> >> Well, I'm not serious above, but I think all my points from the >> earlier version are still valid. I don't like this. It changes the >> parameters of the ioctl (bpp used to be bits-per-pixel, not it's >> "color mode"), and the behavior of the ioctl, behavior that we've had >> for a very long time, and we have no idea how many users there are >> that will break (could be none, of course). And the documentation >> changes make the current behavior and uses wrong or legacy. > > Before I go into details about this statement, what use case exactly are > you referring to when you say that behavior changes? For every dumb_buffer allocation with bpp that is not divisible by 8, the result is different, i.e. instead of DIV_ROUND_UP(width * bpp, 8), we now have width * DIV_ROUND_UP(bpp, 8). This, of course, depends on the driver implementation. Some already do the latter. This change also first calls the drm_driver_color_mode_format(), which could change the behavior even more, but afaics at the moment does not. Although, maybe some platform does width * DIV_ROUND_UP(bpp, 8) even for bpp < 8, and then this series changes it for 1, 2 and 4 bpps (but not for 3, 5, 6, 7, if I'm not mistaken). However, as the bpp is getting rounded up, this probably won't break any user. But it _is_ a change in the behavior of a uapi, and every time we change a uapi that's been out there for a long time, I'm getting slightly uncomfortable. So, as a summary, I have a feeling that nothing will break, but I can't say for sure. And as I'm having trouble seeing the benefit of this change for the user, I get even more uncomfortable. Tomi _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip