Commit b1fb00db authored by Tomohito Esaki's avatar Tomohito Esaki

compositor-drm: Add Support virtual output

Add support virtual output for streaming image to remote output by
remoting-plugin which will be added by the patch:
"Add remoting plugin for output streaming."
The gbm bo of virtual output is the linear format.

Virtual output is implemented based on a patch by Grigory Kletsko
<grigory.kletsko@cogentembedded.com>.
Signed-off-by: Tomohito Esaki's avatarTomohito Esaki <etom@igel.co.jp>
parent 718a40b4
This diff is collapsed.
......@@ -90,6 +90,79 @@ weston_drm_output_get_api(struct weston_compositor *compositor)
return (const struct weston_drm_output_api *)api;
}
#define WESTON_DRM_VIRTUAL_OUTPUT_API_NAME "weston_drm_virtual_output_api_v1"
struct drm_fb;
typedef int (*submit_frame_cb)(struct weston_output *output, int fd,
int stride, struct drm_fb *buffer);
struct weston_drm_virtual_output_api {
/** Create virtual output.
* This is a low-level function, where the caller is expected to wrap
* the weston_output function pointers as necessary to make the virtual
* output useful. The caller must set up output make, model, serial,
* physical size, the mode list and current mode.
*
* Returns output on success, NULL on failure.
*/
struct weston_output* (*create_output)(struct weston_compositor *c,
char *name);
/** Set pixel format same as drm_output set_gbm_format().
*
* Returns the set format.
*/
uint32_t (*set_gbm_format)(struct weston_output *output,
const char *gbm_format);
/** Set a callback to be called when the DRM-backend has drawn a new
* frame and submits it for display.
* The callback will deliver a buffer to the virtual output's the
* owner and assumes the buffer is now reserved for the owner. The
* callback is called in virtual output repaint function.
* The caller must call buffer_released() and finish_frame().
*
* The callback parameters are output, FD and stride (bytes) of dmabuf,
* and buffer (drm_fb) pointer.
* The callback returns 0 on success, -1 on failure.
*
* The submit_frame_cb callback hook is responsible for closing the fd
* if it returns success. One needs to call the buffer release and
* finish frame functions if and only if this hook returns success.
*/
void (*set_submit_frame_cb)(struct weston_output *output,
submit_frame_cb cb);
/** Get fd for renderer fence.
* The returned fence signals when the renderer job has completed and
* the buffer is fully drawn.
*
* Returns fd on success, -1 on failure.
*/
int (*get_fence_sync_fd)(struct weston_output *output);
/** Notify that the caller has finished using buffer */
void (*buffer_released)(struct drm_fb *fb);
/** Notify finish frame
* This function allows the output repainting mechanism to advance to
* the next frame.
*/
void (*finish_frame)(struct weston_output *output,
struct timespec *stamp,
uint32_t presented_flags);
};
static inline const struct weston_drm_virtual_output_api *
weston_drm_virtual_output_get_api(struct weston_compositor *compositor)
{
const void *api;
api = weston_plugin_api_get(compositor,
WESTON_DRM_VIRTUAL_OUTPUT_API_NAME,
sizeof(struct weston_drm_virtual_output_api));
return (const struct weston_drm_virtual_output_api *)api;
}
/** The backend configuration struct.
*
* weston_drm_backend_config contains the configuration used by a DRM
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment