Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Only for you: Attached.

Marek

On Sun, Dec 15, 2024 at 6:37 PM Joshua Ashton <joshua@xxxxxxxxx> wrote:
You should just re-send the whole patch, probably.

On 12/15/24 8:54 PM, Marek Olšák wrote:
> Missed 2 lines from the diff:
>
> +#define DRM_FORMAT_MOD_LINEAR_PITCH_ALIGN_128B fourcc_mod_code(NONE, 2)
> +#define DRM_FORMAT_MOD_LINEAR_PITCH_ALIGN_256B fourcc_mod_code(NONE, 3)
>
> Marek
>
> On Sun, Dec 15, 2024 at 3:53 PM Marek Olšák <maraeo@xxxxxxxxx
> <mailto:maraeo@xxxxxxxxx>> wrote:
>
>     The comment explains the problem with DRM_FORMAT_MOD_LINEAR.
>
>     Signed-off-by: Marek Olšák <marek.olsak@xxxxxxx
>     <mailto:marek.olsak@xxxxxxx>>
>
>     diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/
>     drm_fourcc.h
>     index 78abd819fd62e..8ec4163429014 100644
>     --- a/include/uapi/drm/drm_fourcc.h
>     +++ b/include/uapi/drm/drm_fourcc.h
>     @@ -484,9 +484,27 @@ extern "C" {
>        * modifier (e.g. not setting DRM_MODE_FB_MODIFIERS in the
>     DRM_ADDFB2 ioctl),
>        * which tells the driver to also take driver-internal information
>     into account
>        * and so might actually result in a tiled framebuffer.
>     + *
>     + * WARNING:
>     + * There are drivers out there that expose DRM_FORMAT_MOD_LINEAR,
>     but only
>     + * support a certain pitch alignment and can't import images with
>     this modifier
>     + * if the pitch alignment isn't exactly the one supported. They can
>     however
>     + * allocate images with this modifier and other drivers can import
>     them only
>     + * if they support the same pitch alignment. Thus,
>     DRM_FORMAT_MOD_LINEAR is
>     + * fundamentically incompatible across devices and is the only
>     modifier that
>     + * has a chance of not working. The PITCH_ALIGN modifiers should be
>     used
>     + * instead.
>        */
>       #define DRM_FORMAT_MOD_LINEAR  fourcc_mod_code(NONE, 0)
>
>     +/* Linear layout modifiers with an explicit pitch alignment in bytes.
>     + * Exposing this modifier requires that the pitch alignment is exactly
>     + * the number in the definition.
>     + */
>     +#define DRM_FORMAT_MOD_LINEAR_PITCH_ALIGN_64B fourcc_mod_code(NONE, 1)
>

- Joshie 🐸✨

From 50e6aa4f5182da5ce247a95c9ac69eaeb349cb9e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= <marek.olsak@xxxxxxx>
Date: Sun, 15 Dec 2024 15:49:30 -0500
Subject: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch
 alignment
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The comment explains the problem with DRM_FORMAT_MOD_LINEAR.

Signed-off-by: Marek Olšák <marek.olsak@xxxxxxx>
---
 include/uapi/drm/drm_fourcc.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
index 78abd819fd62e..8ec4163429014 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -484,9 +484,27 @@ extern "C" {
  * modifier (e.g. not setting DRM_MODE_FB_MODIFIERS in the DRM_ADDFB2 ioctl),
  * which tells the driver to also take driver-internal information into account
  * and so might actually result in a tiled framebuffer.
+ *
+ * WARNING:
+ * There are drivers out there that expose DRM_FORMAT_MOD_LINEAR, but only
+ * support a certain pitch alignment and can't import images with this modifier
+ * if the pitch alignment isn't exactly the one supported. They can however
+ * allocate images with this modifier and other drivers can import them only
+ * if they support the same pitch alignment. Thus, DRM_FORMAT_MOD_LINEAR is
+ * fundamentically incompatible across devices and is the only modifier that
+ * has a chance of not working. The PITCH_ALIGN modifiers should be used
+ * instead.
  */
 #define DRM_FORMAT_MOD_LINEAR	fourcc_mod_code(NONE, 0)
 
+/* Linear layout modifiers with an explicit pitch alignment in bytes.
+ * Exposing this modifier requires that the pitch alignment is exactly
+ * the number in the definition.
+ */
+#define DRM_FORMAT_MOD_LINEAR_PITCH_ALIGN_64B fourcc_mod_code(NONE, 1)
+#define DRM_FORMAT_MOD_LINEAR_PITCH_ALIGN_128B fourcc_mod_code(NONE, 2)
+#define DRM_FORMAT_MOD_LINEAR_PITCH_ALIGN_256B fourcc_mod_code(NONE, 3)
+
 /*
  * Deprecated: use DRM_FORMAT_MOD_LINEAR instead
  *
-- 
2.43.0


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux