summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-08-06 11:00:27 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-08-06 19:13:39 +0200
commit50a18e42501a35393a22524d2b01d15f0120e131 (patch)
tree6ad8d874b82bfa78d7a4ed17a4f2ecb659b9fc9a
parent41ceaf0fd179627960ae186f5fc3099e99157339 (diff)
wayland: allow de-interlaced picture buffers.{merged}/staging.12.wayland
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
-rw-r--r--src/i965_output_wayland.c31
-rw-r--r--src/wayland-drm-client-protocol.h25
-rw-r--r--src/wayland/wayland-drm.xml18
3 files changed, 71 insertions, 3 deletions
diff --git a/src/i965_output_wayland.c b/src/i965_output_wayland.c
index 30ffb71..44d0d36 100644
--- a/src/i965_output_wayland.c
+++ b/src/i965_output_wayland.c
@@ -129,6 +129,32 @@ create_planar_buffer(
return (struct wl_buffer *)id;
}
+/* Set picture structure to Wayland buffer, based on client flags */
+static void
+set_picture_structure(
+ struct va_wl_output *wl_output,
+ struct wl_buffer *buffer,
+ unsigned int flags
+)
+{
+ struct wl_vtable * const wl_vtable = &wl_output->vtable;
+ unsigned int picture_structure;
+
+ if (flags & VA_TOP_FIELD)
+ picture_structure = WL_DRM_PICTURE_STRUCTURE_TOP_FIELD;
+ else if (flags & VA_BOTTOM_FIELD)
+ picture_structure = WL_DRM_PICTURE_STRUCTURE_BOTTOM_FIELD;
+ else
+ picture_structure = WL_DRM_PICTURE_STRUCTURE_FRAME;
+
+ wl_vtable->proxy_marshal(
+ (struct wl_proxy *)wl_output->wl_drm,
+ WL_DRM_BUFFER_SET_PICTURE_STRUCTURE,
+ buffer,
+ picture_structure
+ );
+}
+
/* Hook to return Wayland buffer associated with the VA surface */
static VAStatus
va_GetSurfaceBufferWl(
@@ -148,9 +174,6 @@ va_GetSurfaceBufferWl(
if (!obj_surface)
return VA_STATUS_ERROR_INVALID_SURFACE;
- if (flags != VA_FRAME_PICTURE)
- return VA_STATUS_ERROR_FLAG_NOT_SUPPORTED;
-
if (!out_buffer)
return VA_STATUS_ERROR_INVALID_PARAMETER;
@@ -215,6 +238,8 @@ va_GetSurfaceBufferWl(
if (!buffer)
return VA_STATUS_ERROR_ALLOCATION_FAILED;
+ set_picture_structure(i965->wl_output, buffer, flags);
+
*out_buffer = buffer;
return VA_STATUS_SUCCESS;
}
diff --git a/src/wayland-drm-client-protocol.h b/src/wayland-drm-client-protocol.h
index cba188e..f497159 100644
--- a/src/wayland-drm-client-protocol.h
+++ b/src/wayland-drm-client-protocol.h
@@ -115,6 +115,23 @@ enum wl_drm_format {
};
#endif /* WL_DRM_FORMAT_ENUM */
+#ifndef WL_DRM_PICTURE_STRUCTURE_ENUM
+#define WL_DRM_PICTURE_STRUCTURE_ENUM
+/**
+ * wl_drm_picture_structure - wl_drm
+ * @WL_DRM_PICTURE_STRUCTURE_FRAME: WL_DRM
+ * @WL_DRM_PICTURE_STRUCTURE_TOP_FIELD: WL_DRM
+ * @WL_DRM_PICTURE_STRUCTURE_BOTTOM_FIELD: WL_DRM
+ *
+ * Picture structure.
+ */
+enum wl_drm_picture_structure {
+ WL_DRM_PICTURE_STRUCTURE_FRAME = 0,
+ WL_DRM_PICTURE_STRUCTURE_TOP_FIELD = 1,
+ WL_DRM_PICTURE_STRUCTURE_BOTTOM_FIELD = 2,
+};
+#endif /* WL_DRM_PICTURE_STRUCTURE_ENUM */
+
struct wl_drm_listener {
/**
* device - device
@@ -148,6 +165,7 @@ wl_drm_add_listener(struct wl_drm *wl_drm,
#define WL_DRM_AUTHENTICATE 0
#define WL_DRM_CREATE_BUFFER 1
#define WL_DRM_CREATE_PLANAR_BUFFER 2
+#define WL_DRM_BUFFER_SET_PICTURE_STRUCTURE 3
static inline void
wl_drm_set_user_data(struct wl_drm *wl_drm, void *user_data)
@@ -206,6 +224,13 @@ wl_drm_create_planar_buffer(struct wl_drm *wl_drm, uint32_t name, int32_t width,
return (struct wl_buffer *) id;
}
+static inline void
+wl_drm_buffer_set_picture_structure(struct wl_drm *wl_drm, struct wl_buffer *buffer, uint32_t picture_structure)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_drm,
+ WL_DRM_BUFFER_SET_PICTURE_STRUCTURE, buffer, picture_structure);
+}
+
#ifdef __cplusplus
}
#endif
diff --git a/src/wayland/wayland-drm.xml b/src/wayland/wayland-drm.xml
index 265d4f8..ecb36a8 100644
--- a/src/wayland/wayland-drm.xml
+++ b/src/wayland/wayland-drm.xml
@@ -100,6 +100,18 @@
<entry name="yvu444" value="0x34325659"/>
</enum>
+ <enum name="picture_structure">
+ <description summary="buffer picture structure">
+ Picture structure.
+ </description>
+ <entry name="frame" value="0"
+ summary="Buffer represents the whole frame"/>
+ <entry name="top_field" value="1"
+ summary="Buffer represents the top field"/>
+ <entry name="bottom_field" value="2"
+ summary="Buffer represents the bottom field"/>
+ </enum>
+
<!-- Call this request with the magic received from drmGetMagic().
It will be passed on to the drmAuthMagic() or
DRIAuthConnection() call. This authentication must be
@@ -135,6 +147,12 @@
<arg name="stride2" type="int"/>
</request>
+ <!-- Assign picture structure to DRM buffer -->
+ <request name="buffer_set_picture_structure">
+ <arg name="buffer" type="object" interface="wl_buffer"/>
+ <arg name="picture_structure" type="uint"/>
+ </request>
+
<!-- Notification of the path of the drm device which is used by
the server. The client should use this device for creating
local buffers. Only buffers created from this device should