diff options
author | Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> | 2018-11-13 09:45:02 +0200 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-11-13 20:38:41 +0000 |
commit | 746ab3bb131dea8ad015e7804bfcdd6b4cc4f44e (patch) | |
tree | f2605239dd5a7aeb766573181b8add23da27ba6d /src/sna/sna_video.h | |
parent | 3ef92c1f591c4699e51bc79d5b0723da0d41c785 (diff) |
sna: Added AYUV format support for textured and sprite video adapters.
v2: Renamed DRM_FORMAT_XYUV to DRM_FORMAT_XYUV8888.
Added comment about AYUV byte ordering in Gstreamer.
v3: Removed sna_composite_op flags related change to the separate patch.
v4: Fixed review comments, done code refactoring
v5: Fixed following review comments:
- Fixed comment in shader code for ayuv kernel.
- Fixed naming to VIDEO_AYUV_BT601/BT709 for ayuv kernels.
- Removed duplicate gen9_kernel parameter, left from previous patches
- Added colorspace handling for new AYUV kernel
- Fixed naming of sna_copy_packed_data_ayuv to sna_copy_ayuv_data
- Started using standard bswap_32 function for byte swapping in sna_copy_ayuv_data
- Removed redundant code in sna_copy_ayuv_data so that it looks more neat
- Fixed XVIMAGE_AYUV structure initialization to contain proper byte sequence for GST
- Fixed bogus comment about subsampling for DRM_FORMAT_XYUV8888
- Fixed AYUV advertisement for all platforms
- Removed unnecessary RGB888 declaration.
v6:
- Fixed surface format not to use alpha as supposed
- Now doing byte swapping always during copy
- Changed hack, required for GST to work to be at one place
- Fixed invalid sampling values for XVIMAGE_AYUV
- Fixed sprite format checking order and images_ayuv definition.
v7:
- Removed reverse_bytes bool parameter, now swapping bytes
for XYUV unconditionally both for textured and sprite modes.
v8:
- Added gen9_images structure, in order to expose AYUV format to
proper platforms.
Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_video.h')
-rw-r--r-- | src/sna/sna_video.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/sna/sna_video.h b/src/sna/sna_video.h index bbd3f0fd..06d43796 100644 --- a/src/sna/sna_video.h +++ b/src/sna/sna_video.h @@ -39,6 +39,7 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define FOURCC_RGB565 ((16 << 24) + ('B' << 16) + ('G' << 8) + 'R') #define FOURCC_RGB888 ((24 << 24) + ('B' << 16) + ('G' << 8) + 'R') #define FOURCC_NV12 (('2' << 24) + ('1' << 16) + ('V' << 8) + 'N') +#define FOURCC_AYUV (('V' << 24) + ('U' << 16) + ('Y' << 8) + 'A') /* * Below, a dummy picture type that is used in XvPutImage @@ -79,6 +80,14 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE. XvTopToBottom \ } +#define XVIMAGE_AYUV { \ + FOURCC_AYUV, XvYUV, LSBFirst, \ + {'A', 'Y', 'U', 'V', 0x00, 0x00, 0x00, 0x10, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}, \ + 32, XvPacked, 1, 0, 0, 0, 0, 8, 8, 8, 1, 1, 1, 1, 1, 1, \ + {'A', 'Y', 'U', 'V', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, \ + XvTopToBottom \ +} + struct sna_video { struct sna *sna; @@ -189,6 +198,16 @@ static inline int is_nv12_fourcc(int id) } } +static inline int is_ayuv_fourcc(int id) +{ + switch (id) { + case FOURCC_AYUV: + return 1; + default: + return 0; + } +} + bool sna_video_clip_helper(struct sna_video *video, struct sna_video_frame *frame, |