lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230322105226.122467-1-randy.li@synaptics.com>
Date:   Wed, 22 Mar 2023 18:52:26 +0800
From:   Hsia-Jun Li <randy.li@...aptics.com>
To:     dri-devel@...ts.freedesktop.org
Cc:     ayaka@...lik.info, maarten.lankhorst@...ux.intel.com,
        mripard@...nel.org, tzimmermann@...e.de, airlied@...il.com,
        daniel@...ll.ch, linux-kernel@...r.kernel.org, tfiga@...omium.org,
        nicolas@...fresne.ca, "Hsia-Jun(Randy) Li" <randy.li@...aptics.com>
Subject: [PATCH] RFC: drm: Create a alloc helper flags blob

From: "Hsia-Jun(Randy) Li" <randy.li@...aptics.com>

In Android, we could also call gralloc to allocate a
graphics buffer for the decoder, display or encoder.
In the GNU Linux, we don't have such framework, the only
thing we could have is the GBM.
Unfortunately, some platforms don't have a GPU may not
ship the gbm library or the GBM is a part of proprietary
GPU driver. They may not know the allocation requirement
for the other display device.

So it would be better to offer an generic interfaces
for the application allocating the buffer from the 3rd place,
likes DMA-heap or DRM dumb.

The storage of this blob would is different to the modifier
blob, userspace would likes the format key and modifiers
data relation. It would be better to let application seek
the allocation flags they want.

Signed-off-by: Hsia-Jun(Randy) Li <randy.li@...aptics.com>
---
 include/uapi/drm/drm_mode.h | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index 46becedf5b2f..ee5b4d5aee0a 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -218,6 +218,11 @@ extern "C" {
 #define DRM_MODE_CONTENT_PROTECTION_DESIRED     1
 #define DRM_MODE_CONTENT_PROTECTION_ENABLED     2
 
+/* DRM buffer allocation flags */
+#define DRM_BUF_ALLOC_FLAG_DUMB_IMPORT		(1UL << 63)
+#define DRM_BUF_ALLOC_FLAG_SEPARATE_PLANE	(1UL << 62)
+/* bits 0~31 were reserved for DMA-heap heap_flags */
+
 /**
  * struct drm_mode_modeinfo - Display mode information.
  * @clock: pixel clock in kHz
@@ -1168,6 +1173,37 @@ struct drm_format_modifier {
 	__u64 modifier;
 };
 
+struct drm_buf_alloc_flags_blob {
+#define FORMAT_BLOB_CURRENT 1
+	/* Version of this blob format */
+	__u32 version;
+
+	/* Flags */
+	__u32 flags;
+
+	/* Number of fourcc formats supported */
+	__u32 count_formats;
+
+	/* Where in this blob the formats exist (in bytes) */
+	__u32 formats_offset;
+
+	/* Number of drm_buf_alloc_flags */
+	__u32 count_alloc_flags;
+
+	/* Where in this blob the modifiers exist (in bytes) */
+	__u32 alloc_flags_offset;
+
+	/* __u32 formats[] */
+	/* struct drm_buf_alloc_flags alloc_flags[] */
+};
+
+struct drm_buf_alloc_flags {
+	__u32 format;
+	__u32 pad;
+	__u64 modifier_mask;
+	__u64 flags;
+};
+
 /**
  * struct drm_mode_create_blob - Create New blob property
  *
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ