• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/common/libva


Commit MetaInfo

Revisiónf2ddc03d0b8f6ba3bb143a086687f1ad386046c6 (tree)
Tiempo2018-12-19 18:08:53
AutorMark Thompson <sw@jkqx...>
CommiterXinfengZhang

Log Message

Allow import of the DRM PRIME 2 memory type

This adds support for import using the VADRMPRIMESurfaceDescriptor
structure, which enables use of format modifiers (required for some
compressed surfaces).

Signed-off-by: Mark Thompson <sw@jkqxz.net>

Cambiar Resumen

Diferencia incremental

--- a/va/va.h
+++ b/va/va.h
@@ -1260,7 +1260,12 @@ typedef enum {
12601260 VASurfaceAttribMaxHeight,
12611261 /** \brief Surface memory type expressed in bit fields (int, read/write). */
12621262 VASurfaceAttribMemoryType,
1263- /** \brief External buffer descriptor (pointer, write). */
1263+ /** \brief External buffer descriptor (pointer, write).
1264+ *
1265+ * Refer to the documentation for the memory type being created to
1266+ * determine what descriptor structure to pass here. If not otherwise
1267+ * stated, the common VASurfaceAttribExternalBuffers should be used.
1268+ */
12641269 VASurfaceAttribExternalBufferDescriptor,
12651270 /** \brief Surface usage hint, gives the driver a hint of intended usage
12661271 * to optimize allocation (e.g. tiling) (int, read/write). */
--- a/va/va_drmcommon.h
+++ b/va/va_drmcommon.h
@@ -90,8 +90,6 @@ struct drm_state {
9090 /**
9191 * \brief External buffer descriptor for a DRM PRIME surface.
9292 *
93- * This can currently only be used for export.
94- *
9593 * For export, call vaExportSurfaceHandle() with mem_type set to
9694 * VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2 and pass a pointer to an
9795 * instance of this structure to fill.
@@ -101,6 +99,23 @@ struct drm_state {
10199 * one of DRM_FORMAT_GR88.
102100 * If VA_EXPORT_SURFACE_COMPOSED_LAYERS is specified on export,
103101 * there will be exactly one layer.
102+ *
103+ * For import, call vaCreateSurfaces() with the MemoryType attribute
104+ * set to VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2 and the
105+ * ExternalBufferDescriptor attribute set to point to an array of
106+ * num_surfaces instances of this structure.
107+ * The number of planes which need to be provided for a given layer
108+ * is dependent on both the format and the format modifier used for
109+ * the objects containing it. For example, the format DRM_FORMAT_RGBA
110+ * normally requires one plane, but with the format modifier
111+ * I915_FORMAT_MOD_Y_TILED_CCS it requires two planes - the first
112+ * being the main data plane and the second containing the color
113+ * control surface.
114+ * Note that a given driver may only support a subset of possible
115+ * representations of a particular format. For example, it may only
116+ * support NV12 surfaces when they are contained within a single DRM
117+ * object, and therefore fail to create such surfaces if the two
118+ * planes are in different DRM objects.
104119 */
105120 typedef struct _VADRMPRIMESurfaceDescriptor {
106121 /** Pixel format fourcc of the whole surface (VA_FOURCC_*). */