From: Pekka Paalanen <ppaalanen@gmail.com>
To: Hsia-Jun Li <randy.li@synaptics.com>
Cc: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org,
hverkuil@xs4all.nl, tfiga@chromium.org, nicolas@ndufresne.ca,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch,
linux-kernel@vger.kernel.org, ayaka@soulik.info
Subject: Re: [RFC] drm/fourcc: Add a modifier for contiguous memory
Date: Tue, 29 Nov 2022 12:48:59 +0200 [thread overview]
Message-ID: <20221129124859.6aa3ff00@eldfell> (raw)
In-Reply-To: <20221129101030.57499-1-randy.li@synaptics.com>
[-- Attachment #1: Type: text/plain, Size: 2596 bytes --]
On Tue, 29 Nov 2022 18:10:30 +0800
Hsia-Jun Li <randy.li@synaptics.com> wrote:
> From: "Hsia-Jun(Randy) Li" <randy.li@synaptics.com>
>
> Hello All
>
> Currently, we assume all the pixel formats are multiple planes,
Hi,
that's not true for any definition of "multiple planes" that I know of.
For example, DRM_FORMAT_XRGB8888 is a single-plane format by definition.
From below it sounds like you mean "physically non-contiguous". But no,
pixel formats make no such assumption at all. Contiguous or not is
independent of pixel formats.
> devices
> could support each component has its own memory plane.
> But that may not apply for any device in the world. We could have a
> device without IOMMU then this is not impossible.
>
> Besides, when we export an handle through the PRIME, the upstream
> device(likes a capture card or camera) may not support non-contiguous
> memory. It would be better to allocate the handle in contiguous memory
> at the first time.
>
> We may think the memory allocation is done in user space, we could do
> the trick there. But the dumb_create() sometimes is not the right API
> for that.
>
> "Note that userspace is not allowed to use such objects for render
> acceleration - drivers must create their own private ioctls for such a
> use case."
> "Note that dumb objects may not be used for gpu acceleration, as has
> been attempted on some ARM embedded platforms. Such drivers really must
> have a hardware-specific ioctl to allocate suitable buffer objects."
>
> We need to relay on those device custom APIs then. It would be helpful
> for their library to calculate the right size for contiguous memory. It
> would be useful for the driver supports rendering dumb buffer as well.
>
> Signed-off-by: Hsia-Jun(Randy) Li <randy.li@synaptics.com>
> ---
> include/uapi/drm/drm_fourcc.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
> index bc056f2d537d..ec039ced8257 100644
> --- a/include/uapi/drm/drm_fourcc.h
> +++ b/include/uapi/drm/drm_fourcc.h
> @@ -473,6 +473,11 @@ extern "C" {
> */
> #define DRM_FORMAT_MOD_LINEAR fourcc_mod_code(NONE, 0)
>
> +/*
> + * Contiguous memory
> + */
> +#define DRM_FORMAT_MOD_CONTIG_MEM fourcc_mod_code(NONE, 1)
NAK. This is not what modifiers are for.
This also would not work in practise, because if this was a modifier,
you would not be able to use the actual modifiers.
Thanks,
pq
> +
> /*
> * Deprecated: use DRM_FORMAT_MOD_LINEAR instead
> *
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2022-11-29 10:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-29 10:10 [RFC] drm/fourcc: Add a modifier for contiguous memory Hsia-Jun Li
2022-11-29 10:18 ` Simon Ser
2022-11-29 10:46 ` Hsia-Jun Li
2022-11-29 10:42 ` Daniel Stone
2022-11-29 10:57 ` Hsia-Jun Li
2022-11-29 10:48 ` Pekka Paalanen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221129124859.6aa3ff00@eldfell \
--to=ppaalanen@gmail.com \
--cc=airlied@gmail.com \
--cc=ayaka@soulik.info \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nicolas@ndufresne.ca \
--cc=randy.li@synaptics.com \
--cc=tfiga@chromium.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox