aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/uapi/video/adf.h46
-rw-r--r--include/video/adf.h18
-rw-r--r--include/video/adf_client.h4
3 files changed, 68 insertions, 0 deletions
diff --git a/include/uapi/video/adf.h b/include/uapi/video/adf.h
index 757465b8b58..4b9e60c84e6 100644
--- a/include/uapi/video/adf.h
+++ b/include/uapi/video/adf.h
@@ -152,6 +152,50 @@ struct adf_post_config {
#define ADF_MAX_INTERFACES (PAGE_SIZE / sizeof(__u32))
/**
+ * struct adf_simple_buffer_allocate - request to allocate a "simple" buffer
+ *
+ * @w: width of buffer in pixels (input)
+ * @h: height of buffer in pixels (input)
+ * @format: DRM-style fourcc (input)
+ *
+ * @fd: dma_buf fd (output)
+ * @offset: location of first pixel, in bytes (output)
+ * @pitch: length of a scanline including padding, in bytes (output)
+ *
+ * Simple buffers are analogous to DRM's "dumb" buffers. They have a single
+ * plane of linear RGB data which can be allocated and scanned out without
+ * any driver-private ioctls or data.
+ *
+ * @format must be a standard RGB format defined in drm_fourcc.h.
+ *
+ * ADF clients must NOT assume that an interface can scan out a simple buffer
+ * allocated by a different ADF interface, even if the two interfaces belong to
+ * the same ADF device.
+ */
+struct adf_simple_buffer_alloc {
+ __u16 w;
+ __u16 h;
+ __u32 format;
+
+ __s64 fd;
+ __u32 offset;
+ __u32 pitch;
+};
+
+/**
+ * struct adf_simple_post_config - request to flip to a single buffer without
+ * driver-private data
+ *
+ * @buf: description of buffer displayed (input)
+ * @complete_fence: sync_fence fd which will clear when this buffer has left the
+ * screen (output)
+ */
+struct adf_simple_post_config {
+ struct adf_buffer_config buf;
+ __s64 complete_fence;
+};
+
+/**
* struct adf_attachment_config - description of attachment between an overlay
* engine and an interface
*
@@ -248,6 +292,8 @@ struct adf_overlay_engine_data {
#define ADF_GET_INTERFACE_DATA _IOR('D', 5, struct adf_interface_data)
#define ADF_GET_OVERLAY_ENGINE_DATA \
_IOR('D', 6, struct adf_overlay_engine_data)
+#define ADF_SIMPLE_POST_CONFIG _IOW('D', 7, struct adf_simple_post_config)
+#define ADF_SIMPLE_BUFFER_ALLOC _IOW('D', 8, struct adf_simple_buffer_alloc)
#define ADF_ATTACH _IOW('D', 9, struct adf_attachment_config)
#define ADF_DETACH _IOW('D', 10, struct adf_attachment_config)
diff --git a/include/video/adf.h b/include/video/adf.h
index c09d8dfb4d6..6c2191a318a 100644
--- a/include/video/adf.h
+++ b/include/video/adf.h
@@ -299,6 +299,16 @@ struct adf_device {
* @blank: change the display's DPMS state. Return 0 on success or error
* code (<0) on failure.
*
+ * @alloc_simple_buffer: allocate a buffer with the specified @w, @h, and
+ * @format. @format will be a standard RGB format (i.e.,
+ * adf_format_is_rgb(@format) == true). Return 0 on success or error code
+ * (<0) on failure. On success, return the buffer, offset, and pitch in
+ * @dma_buf, @offset, and @pitch respectively.
+ * @describe_simple_post: provide driver-private data needed to post a single
+ * buffer @buf. Copy up to ADF_MAX_CUSTOM_DATA_SIZE bytes into @data
+ * (allocated by ADF) and return the number of bytes in @size. Return 0 on
+ * success or error code (<0) on failure.
+ *
* @modeset: change the interface's mode. @mode is not necessarily part of the
* modelist passed to adf_hotplug_notify_connected(); the driver may
* accept or reject custom modes at its discretion. Return 0 on success or
@@ -318,6 +328,14 @@ struct adf_interface_ops {
int (*blank)(struct adf_interface *intf, u8 state);
/* optional */
+ int (*alloc_simple_buffer)(struct adf_interface *intf,
+ u16 w, u16 h, u32 format,
+ struct dma_buf **dma_buf, u32 *offset, u32 *pitch);
+ /* optional */
+ int (*describe_simple_post)(struct adf_interface *intf,
+ struct adf_buffer *fb, void *data, size_t *size);
+
+ /* optional */
int (*modeset)(struct adf_interface *intf,
struct drm_mode_modeinfo *mode);
diff --git a/include/video/adf_client.h b/include/video/adf_client.h
index 1e471a48998..983f2b6a589 100644
--- a/include/video/adf_client.h
+++ b/include/video/adf_client.h
@@ -28,6 +28,10 @@ int adf_interface_set_mode(struct adf_interface *intf,
struct drm_mode_modeinfo *mode);
int adf_interface_get_screen_size(struct adf_interface *intf, u16 *width,
u16 *height);
+int adf_interface_simple_buffer_alloc(struct adf_interface *intf, u16 w, u16 h,
+ u32 format, struct dma_buf **dma_buf, u32 *offset, u32 *pitch);
+struct sync_fence *adf_interface_simple_post(struct adf_interface *intf,
+ struct adf_buffer *buf);
bool adf_overlay_engine_supports_format(struct adf_overlay_engine *eng,
u32 format);