video: adf: support "simple" buffers
Simple buffers are linear RGB buffers analogous to KMS's dumb buffers.
Simple buffers can be allocated and posted to a display interface
without any driver-private data.
Internally, ADF drivers provide the driver-private data needed (if any)
to post a simple buffer to the display.
Change-Id: Ib0b737622eaf343111310f6623f99d69cf3807d2
Signed-off-by: Greg Hackmann <ghackmann@google.com>
diff --git a/include/video/adf.h b/include/video/adf.h
index c09d8df..6c2191a 100644
--- a/include/video/adf.h
+++ b/include/video/adf.h
@@ -299,6 +299,16 @@
* @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 @@
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);