msm: vidc: Allow clients to specify/query the colorspace

When encoder clients specify the color space, the resulting bitstream
will have the color space embedded in it.  This allows for the
decoder to display the picture accurately without the color being
skewed.
Similarly decoder clients can query the color space of the bitstream by
enabling MSM_VIDC_EXTRADATA_VUI_DISPLAY_INFO.  If the bitstream contains
the colorspace hint, the appropriate extradata will be emitted by the
decoder.

Change-Id: I83a3e28b13c3aa306e7cc2d1552a6d39c0d3d49f
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Signed-off-by: Praveen Chavan <pchavan@codeaurora.org>
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index e03d605..0212b5c 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1853,7 +1853,8 @@
         V4L2_MPEG_VIDC_EXTRADATA_FRAME_QP,
         V4L2_MPEG_VIDC_EXTRADATA_FRAME_BITS_INFO,
         V4L2_MPEG_VIDC_EXTRADATA_METADATA_MBI,
-	V4L2_MPEG_VIDC_EXTRADATA_LTR
+	V4L2_MPEG_VIDC_EXTRADATA_LTR,
+	V4L2_MPEG_VIDC_EXTRADATA_VUI_DISPLAY
 };
 
 #define V4L2_CID_MPEG_VIDC_SET_PERF_LEVEL (V4L2_CID_MPEG_MSM_VIDC_BASE + 26)
diff --git a/include/media/msm_vidc.h b/include/media/msm_vidc.h
index 0a91e32..24d36ca 100644
--- a/include/media/msm_vidc.h
+++ b/include/media/msm_vidc.h
@@ -155,6 +155,24 @@
         unsigned int fpa_extension_flag;
 };
 
+struct msm_vidc_vui_display_info_payload {
+	unsigned int video_signal_present_flag;
+	unsigned int video_format;
+	unsigned int bit_depth_y;
+	unsigned int bit_depth_c;
+	unsigned int video_full_range_flag;
+	unsigned int color_description_present_flag;
+	unsigned int color_primaries;
+	unsigned int transfer_characteristics;
+	unsigned int matrix_coefficients;
+	unsigned int chroma_location_info_present_flag;
+	unsigned int chroma_format_idc;
+	unsigned int separate_color_plane_flag;
+	unsigned int chroma_sample_loc_type_top_field;
+	unsigned int chroma_sample_loc_type_bottom_field;
+};
+
+
 enum msm_vidc_extradata_type {
         MSM_VIDC_EXTRADATA_NONE = 0x00000000,
         MSM_VIDC_EXTRADATA_MB_QUANTIZATION = 0x00000001,
@@ -179,6 +197,7 @@
         MSM_VIDC_EXTRADATA_METADATA_LTR = 0x7F100004,
         MSM_VIDC_EXTRADATA_METADATA_FILLER = 0x7FE00002,
         MSM_VIDC_EXTRADATA_METADATA_MBI = 0x7F100005,
+	MSM_VIDC_EXTRADATA_VUI_DISPLAY_INFO = 0x7F100006,
 };
 enum msm_vidc_interlace_type {
 	MSM_VIDC_INTERLACE_FRAME_PROGRESSIVE = 0x01,