]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/drm/drm_dp_helper.h
Merge remote-tracking branch 'drm-misc/topic/drm-misc'
[karo-tx-linux.git] / include / drm / drm_dp_helper.h
index 0212d139a480909a216da244ffd8aadf6effa630..1252108da0efcfafe809bfb955bf88a5e71ac965 100644 (file)
@@ -46,7 +46,7 @@
 
 #define DP_AUX_I2C_WRITE               0x0
 #define DP_AUX_I2C_READ                        0x1
-#define DP_AUX_I2C_STATUS              0x2
+#define DP_AUX_I2C_WRITE_STATUS_UPDATE 0x2
 #define DP_AUX_I2C_MOT                 0x4
 #define DP_AUX_NATIVE_WRITE            0x8
 #define DP_AUX_NATIVE_READ             0x9
 # define DP_EDP_14                         0x03
 
 #define DP_EDP_GENERAL_CAP_1               0x701
+# define DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP          (1 << 0)
+# define DP_EDP_BACKLIGHT_PIN_ENABLE_CAP               (1 << 1)
+# define DP_EDP_BACKLIGHT_AUX_ENABLE_CAP               (1 << 2)
+# define DP_EDP_PANEL_SELF_TEST_PIN_ENABLE_CAP         (1 << 3)
+# define DP_EDP_PANEL_SELF_TEST_AUX_ENABLE_CAP         (1 << 4)
+# define DP_EDP_FRC_ENABLE_CAP                         (1 << 5)
+# define DP_EDP_COLOR_ENGINE_CAP                       (1 << 6)
+# define DP_EDP_SET_POWER_CAP                          (1 << 7)
 
 #define DP_EDP_BACKLIGHT_ADJUSTMENT_CAP     0x702
+# define DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP       (1 << 0)
+# define DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP       (1 << 1)
+# define DP_EDP_BACKLIGHT_BRIGHTNESS_BYTE_COUNT                (1 << 2)
+# define DP_EDP_BACKLIGHT_AUX_PWM_PRODUCT_CAP          (1 << 3)
+# define DP_EDP_BACKLIGHT_FREQ_PWM_PIN_PASSTHRU_CAP    (1 << 4)
+# define DP_EDP_BACKLIGHT_FREQ_AUX_SET_CAP             (1 << 5)
+# define DP_EDP_DYNAMIC_BACKLIGHT_CAP                  (1 << 6)
+# define DP_EDP_VBLANK_BACKLIGHT_UPDATE_CAP            (1 << 7)
 
 #define DP_EDP_GENERAL_CAP_2               0x703
+# define DP_EDP_OVERDRIVE_ENGINE_ENABLED               (1 << 0)
 
 #define DP_EDP_GENERAL_CAP_3               0x704    /* eDP 1.4 */
+# define DP_EDP_X_REGION_CAP_MASK                      (0xf << 0)
+# define DP_EDP_X_REGION_CAP_SHIFT                     0
+# define DP_EDP_Y_REGION_CAP_MASK                      (0xf << 4)
+# define DP_EDP_Y_REGION_CAP_SHIFT                     4
 
 #define DP_EDP_DISPLAY_CONTROL_REGISTER     0x720
+# define DP_EDP_BACKLIGHT_ENABLE                       (1 << 0)
+# define DP_EDP_BLACK_VIDEO_ENABLE                     (1 << 1)
+# define DP_EDP_FRC_ENABLE                             (1 << 2)
+# define DP_EDP_COLOR_ENGINE_ENABLE                    (1 << 3)
+# define DP_EDP_VBLANK_BACKLIGHT_UPDATE_ENABLE         (1 << 7)
 
 #define DP_EDP_BACKLIGHT_MODE_SET_REGISTER  0x721
+# define DP_EDP_BACKLIGHT_CONTROL_MODE_MASK            (3 << 0)
+# define DP_EDP_BACKLIGHT_CONTROL_MODE_PWM             (0 << 0)
+# define DP_EDP_BACKLIGHT_CONTROL_MODE_PRESET          (1 << 0)
+# define DP_EDP_BACKLIGHT_CONTROL_MODE_DPCD            (2 << 0)
+# define DP_EDP_BACKLIGHT_CONTROL_MODE_PRODUCT         (3 << 0)
+# define DP_EDP_BACKLIGHT_FREQ_PWM_PIN_PASSTHRU_ENABLE (1 << 2)
+# define DP_EDP_BACKLIGHT_FREQ_AUX_SET_ENABLE          (1 << 3)
+# define DP_EDP_DYNAMIC_BACKLIGHT_ENABLE               (1 << 4)
+# define DP_EDP_REGIONAL_BACKLIGHT_ENABLE              (1 << 5)
+# define DP_EDP_UPDATE_REGION_BRIGHTNESS               (1 << 6) /* eDP 1.4 */
 
 #define DP_EDP_BACKLIGHT_BRIGHTNESS_MSB     0x722
 #define DP_EDP_BACKLIGHT_BRIGHTNESS_LSB     0x723
@@ -638,6 +674,13 @@ drm_dp_enhanced_frame_cap(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
                (dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP);
 }
 
+static inline bool
+drm_dp_tps3_supported(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
+{
+       return dpcd[DP_DPCD_REV] >= 0x12 &&
+               dpcd[DP_MAX_LANE_COUNT] & DP_TPS3_SUPPORTED;
+}
+
 /*
  * DisplayPort AUX channel
  */