diff options
author | Greg Hackmann <ghackmann@google.com> | 2013-10-10 13:03:26 -0700 |
---|---|---|
committer | Greg Hackmann <ghackmann@google.com> | 2013-10-11 16:45:07 -0700 |
commit | b07062e41853a8096096d3a75767b955e13a57bb (patch) | |
tree | f463daef2e08f2a61e745593833a8b1d050684ec /include/video | |
parent | 23240e2e9a0420a4d1cf460a8c3549e952656f89 (diff) |
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>
Diffstat (limited to 'include/video')
-rw-r--r-- | include/video/adf.h | 18 | ||||
-rw-r--r-- | include/video/adf_client.h | 4 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/video/adf.h b/include/video/adf.h index c09d8dfb4d6c..6c2191a318a5 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 1e471a489983..983f2b6a5890 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); |