Merge drm/drm-next into drm-misc-next
[linux-2.6-microblaze.git] / drivers / gpu / drm / vc4 / vc4_hdmi.h
index 36c0b08..015a4b7 100644 (file)
@@ -12,7 +12,6 @@
 struct vc4_hdmi_encoder {
        struct vc4_encoder base;
        bool hdmi_monitor;
-       bool limited_rgb_range;
 };
 
 static inline struct vc4_hdmi_encoder *
@@ -77,7 +76,9 @@ struct vc4_hdmi_variant {
        void (*reset)(struct vc4_hdmi *vc4_hdmi);
 
        /* Callback to enable / disable the CSC */
-       void (*csc_setup)(struct vc4_hdmi *vc4_hdmi, bool enable);
+       void (*csc_setup)(struct vc4_hdmi *vc4_hdmi,
+                         struct drm_connector_state *state,
+                         const struct drm_display_mode *mode);
 
        /* Callback to configure the video timings in the HDMI block */
        void (*set_timings)(struct vc4_hdmi *vc4_hdmi,
@@ -102,6 +103,9 @@ struct vc4_hdmi_variant {
 
        /* Enables HDR metadata */
        bool supports_hdr;
+
+       /* Callback for hardware specific hotplug detect */
+       bool (*hp_detect)(struct vc4_hdmi *vc4_hdmi);
 };
 
 /* HDMI audio information */
@@ -113,9 +117,17 @@ struct vc4_hdmi_audio {
        struct snd_soc_dai_link_component platform;
        struct snd_dmaengine_dai_dma_data dma_data;
        struct hdmi_audio_infoframe infoframe;
+       struct platform_device *codec_pdev;
        bool streaming;
 };
 
+enum vc4_hdmi_output_format {
+       VC4_HDMI_OUTPUT_RGB,
+       VC4_HDMI_OUTPUT_YUV422,
+       VC4_HDMI_OUTPUT_YUV444,
+       VC4_HDMI_OUTPUT_YUV420,
+};
+
 /* General HDMI hardware state. */
 struct vc4_hdmi {
        struct vc4_hdmi_audio audio;
@@ -215,6 +227,18 @@ struct vc4_hdmi {
         * the scrambler on? Protected by @mutex.
         */
        bool scdc_enabled;
+
+       /**
+        * @output_bpc: Copy of @vc4_connector_state.output_bpc for use
+        * outside of KMS hooks. Protected by @mutex.
+        */
+       unsigned int output_bpc;
+
+       /**
+        * @output_format: Copy of @vc4_connector_state.output_format
+        * for use outside of KMS hooks. Protected by @mutex.
+        */
+       enum vc4_hdmi_output_format output_format;
 };
 
 static inline struct vc4_hdmi *
@@ -233,7 +257,9 @@ encoder_to_vc4_hdmi(struct drm_encoder *encoder)
 
 struct vc4_hdmi_connector_state {
        struct drm_connector_state      base;
-       unsigned long long              pixel_rate;
+       unsigned long long              tmds_char_rate;
+       unsigned int                    output_bpc;
+       enum vc4_hdmi_output_format     output_format;
 };
 
 static inline struct vc4_hdmi_connector_state *