sync with OpenBSD -current
This commit is contained in:
parent
8801582927
commit
30cf31d90d
55 changed files with 633 additions and 516 deletions
|
@ -1500,6 +1500,13 @@ static void gen11_dsi_post_disable(struct intel_atomic_state *state,
|
|||
static enum drm_mode_status gen11_dsi_mode_valid(struct drm_connector *connector,
|
||||
struct drm_display_mode *mode)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(connector->dev);
|
||||
enum drm_mode_status status;
|
||||
|
||||
status = intel_cpu_transcoder_mode_valid(i915, mode);
|
||||
if (status != MODE_OK)
|
||||
return status;
|
||||
|
||||
/* FIXME: DSC? */
|
||||
return intel_dsi_mode_valid(connector, mode);
|
||||
}
|
||||
|
|
|
@ -343,8 +343,13 @@ intel_crt_mode_valid(struct drm_connector *connector,
|
|||
struct drm_device *dev = connector->dev;
|
||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||
int max_dotclk = dev_priv->max_dotclk_freq;
|
||||
enum drm_mode_status status;
|
||||
int max_clock;
|
||||
|
||||
status = intel_cpu_transcoder_mode_valid(dev_priv, mode);
|
||||
if (status != MODE_OK)
|
||||
return status;
|
||||
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
|
||||
return MODE_NO_DBLESCAN;
|
||||
|
||||
|
|
|
@ -8229,6 +8229,16 @@ intel_mode_valid(struct drm_device *dev,
|
|||
mode->vtotal > vtotal_max)
|
||||
return MODE_V_ILLEGAL;
|
||||
|
||||
return MODE_OK;
|
||||
}
|
||||
|
||||
enum drm_mode_status intel_cpu_transcoder_mode_valid(struct drm_i915_private *dev_priv,
|
||||
const struct drm_display_mode *mode)
|
||||
{
|
||||
/*
|
||||
* Additional transcoder timing limits,
|
||||
* excluding BXT/GLK DSI transcoders.
|
||||
*/
|
||||
if (DISPLAY_VER(dev_priv) >= 5) {
|
||||
if (mode->hdisplay < 64 ||
|
||||
mode->htotal - mode->hdisplay < 32)
|
||||
|
|
|
@ -556,6 +556,9 @@ enum drm_mode_status
|
|||
intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv,
|
||||
const struct drm_display_mode *mode,
|
||||
bool bigjoiner);
|
||||
enum drm_mode_status
|
||||
intel_cpu_transcoder_mode_valid(struct drm_i915_private *i915,
|
||||
const struct drm_display_mode *mode);
|
||||
enum phy intel_port_to_phy(struct drm_i915_private *i915, enum port port);
|
||||
bool is_trans_port_sync_mode(const struct intel_crtc_state *state);
|
||||
bool intel_crtc_is_bigjoiner_slave(const struct intel_crtc_state *crtc_state);
|
||||
|
|
|
@ -973,8 +973,9 @@ intel_dp_mode_valid(struct drm_connector *_connector,
|
|||
enum drm_mode_status status;
|
||||
bool dsc = false, bigjoiner = false;
|
||||
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
|
||||
return MODE_NO_DBLESCAN;
|
||||
status = intel_cpu_transcoder_mode_valid(dev_priv, mode);
|
||||
if (status != MODE_OK)
|
||||
return status;
|
||||
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLCLK)
|
||||
return MODE_H_ILLEGAL;
|
||||
|
|
|
@ -703,6 +703,10 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector,
|
|||
return 0;
|
||||
}
|
||||
|
||||
*status = intel_cpu_transcoder_mode_valid(dev_priv, mode);
|
||||
if (*status != MODE_OK)
|
||||
return 0;
|
||||
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLSCAN) {
|
||||
*status = MODE_NO_DBLESCAN;
|
||||
return 0;
|
||||
|
|
|
@ -225,10 +225,16 @@ intel_dvo_mode_valid(struct drm_connector *connector,
|
|||
{
|
||||
struct intel_connector *intel_connector = to_intel_connector(connector);
|
||||
struct intel_dvo *intel_dvo = intel_attached_dvo(intel_connector);
|
||||
struct drm_i915_private *i915 = to_i915(intel_connector->base.dev);
|
||||
const struct drm_display_mode *fixed_mode =
|
||||
intel_panel_fixed_mode(intel_connector, mode);
|
||||
int max_dotclk = to_i915(connector->dev)->max_dotclk_freq;
|
||||
int target_clock = mode->clock;
|
||||
enum drm_mode_status status;
|
||||
|
||||
status = intel_cpu_transcoder_mode_valid(i915, mode);
|
||||
if (status != MODE_OK)
|
||||
return status;
|
||||
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
|
||||
return MODE_NO_DBLESCAN;
|
||||
|
|
|
@ -1987,8 +1987,9 @@ intel_hdmi_mode_valid(struct drm_connector *connector,
|
|||
bool has_hdmi_sink = intel_has_hdmi_sink(hdmi, connector->state);
|
||||
bool ycbcr_420_only;
|
||||
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
|
||||
return MODE_NO_DBLESCAN;
|
||||
status = intel_cpu_transcoder_mode_valid(dev_priv, mode);
|
||||
if (status != MODE_OK)
|
||||
return status;
|
||||
|
||||
if ((mode->flags & DRM_MODE_FLAG_3D_MASK) == DRM_MODE_FLAG_3D_FRAME_PACKING)
|
||||
clock *= 2;
|
||||
|
|
|
@ -92,9 +92,9 @@ bool intel_lvds_port_enabled(struct drm_i915_private *dev_priv,
|
|||
|
||||
/* asserts want to know the pipe even if the port is disabled */
|
||||
if (HAS_PCH_CPT(dev_priv))
|
||||
*pipe = (val & LVDS_PIPE_SEL_MASK_CPT) >> LVDS_PIPE_SEL_SHIFT_CPT;
|
||||
*pipe = REG_FIELD_GET(LVDS_PIPE_SEL_MASK_CPT, val);
|
||||
else
|
||||
*pipe = (val & LVDS_PIPE_SEL_MASK) >> LVDS_PIPE_SEL_SHIFT;
|
||||
*pipe = REG_FIELD_GET(LVDS_PIPE_SEL_MASK, val);
|
||||
|
||||
return val & LVDS_PORT_EN;
|
||||
}
|
||||
|
@ -389,11 +389,16 @@ intel_lvds_mode_valid(struct drm_connector *connector,
|
|||
struct drm_display_mode *mode)
|
||||
{
|
||||
struct intel_connector *intel_connector = to_intel_connector(connector);
|
||||
struct drm_i915_private *i915 = to_i915(intel_connector->base.dev);
|
||||
const struct drm_display_mode *fixed_mode =
|
||||
intel_panel_fixed_mode(intel_connector, mode);
|
||||
int max_pixclk = to_i915(connector->dev)->max_dotclk_freq;
|
||||
enum drm_mode_status status;
|
||||
|
||||
status = intel_cpu_transcoder_mode_valid(i915, mode);
|
||||
if (status != MODE_OK)
|
||||
return status;
|
||||
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
|
||||
return MODE_NO_DBLESCAN;
|
||||
|
||||
|
|
|
@ -115,7 +115,6 @@ struct intel_sdvo {
|
|||
|
||||
enum port port;
|
||||
|
||||
bool has_hdmi_monitor;
|
||||
bool has_hdmi_audio;
|
||||
|
||||
/* DDC bus used by this SDVO encoder */
|
||||
|
@ -1278,10 +1277,13 @@ static void i9xx_adjust_sdvo_tv_clock(struct intel_crtc_state *pipe_config)
|
|||
pipe_config->clock_set = true;
|
||||
}
|
||||
|
||||
static bool intel_has_hdmi_sink(struct intel_sdvo *sdvo,
|
||||
static bool intel_has_hdmi_sink(struct intel_sdvo_connector *intel_sdvo_connector,
|
||||
const struct drm_connector_state *conn_state)
|
||||
{
|
||||
return sdvo->has_hdmi_monitor &&
|
||||
struct drm_connector *connector = conn_state->connector;
|
||||
|
||||
return intel_sdvo_connector->is_hdmi &&
|
||||
connector->display_info.is_hdmi &&
|
||||
READ_ONCE(to_intel_digital_connector_state(conn_state)->force_audio) != HDMI_AUDIO_OFF_DVI;
|
||||
}
|
||||
|
||||
|
@ -1360,7 +1362,7 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,
|
|||
pipe_config->pixel_multiplier =
|
||||
intel_sdvo_get_pixel_multiplier(adjusted_mode);
|
||||
|
||||
pipe_config->has_hdmi_sink = intel_has_hdmi_sink(intel_sdvo, conn_state);
|
||||
pipe_config->has_hdmi_sink = intel_has_hdmi_sink(intel_sdvo_connector, conn_state);
|
||||
|
||||
if (pipe_config->has_hdmi_sink) {
|
||||
if (intel_sdvo_state->base.force_audio == HDMI_AUDIO_AUTO)
|
||||
|
@ -1871,13 +1873,19 @@ static enum drm_mode_status
|
|||
intel_sdvo_mode_valid(struct drm_connector *connector,
|
||||
struct drm_display_mode *mode)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(connector->dev);
|
||||
struct intel_sdvo *intel_sdvo = intel_attached_sdvo(to_intel_connector(connector));
|
||||
struct intel_sdvo_connector *intel_sdvo_connector =
|
||||
to_intel_sdvo_connector(connector);
|
||||
int max_dotclk = to_i915(connector->dev)->max_dotclk_freq;
|
||||
bool has_hdmi_sink = intel_has_hdmi_sink(intel_sdvo, connector->state);
|
||||
bool has_hdmi_sink = intel_has_hdmi_sink(intel_sdvo_connector, connector->state);
|
||||
int max_dotclk = i915->max_dotclk_freq;
|
||||
enum drm_mode_status status;
|
||||
int clock = mode->clock;
|
||||
|
||||
status = intel_cpu_transcoder_mode_valid(i915, mode);
|
||||
if (status != MODE_OK)
|
||||
return status;
|
||||
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
|
||||
return MODE_NO_DBLESCAN;
|
||||
|
||||
|
@ -2064,7 +2072,6 @@ intel_sdvo_tmds_sink_detect(struct drm_connector *connector)
|
|||
if (edid->input & DRM_EDID_INPUT_DIGITAL) {
|
||||
status = connector_status_connected;
|
||||
if (intel_sdvo_connector->is_hdmi) {
|
||||
intel_sdvo->has_hdmi_monitor = drm_detect_hdmi_monitor(edid);
|
||||
intel_sdvo->has_hdmi_audio = drm_detect_monitor_audio(edid);
|
||||
}
|
||||
} else
|
||||
|
@ -2116,7 +2123,6 @@ intel_sdvo_detect(struct drm_connector *connector, bool force)
|
|||
|
||||
intel_sdvo->attached_output = response;
|
||||
|
||||
intel_sdvo->has_hdmi_monitor = false;
|
||||
intel_sdvo->has_hdmi_audio = false;
|
||||
|
||||
if ((intel_sdvo_connector->output_flag & response) == 0)
|
||||
|
|
|
@ -956,8 +956,14 @@ static enum drm_mode_status
|
|||
intel_tv_mode_valid(struct drm_connector *connector,
|
||||
struct drm_display_mode *mode)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(connector->dev);
|
||||
const struct tv_mode *tv_mode = intel_tv_mode_find(connector->state);
|
||||
int max_dotclk = to_i915(connector->dev)->max_dotclk_freq;
|
||||
int max_dotclk = i915->max_dotclk_freq;
|
||||
enum drm_mode_status status;
|
||||
|
||||
status = intel_cpu_transcoder_mode_valid(i915, mode);
|
||||
if (status != MODE_OK)
|
||||
return status;
|
||||
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
|
||||
return MODE_NO_DBLESCAN;
|
||||
|
|
|
@ -1627,9 +1627,25 @@ static const struct drm_encoder_funcs intel_dsi_funcs = {
|
|||
.destroy = intel_dsi_encoder_destroy,
|
||||
};
|
||||
|
||||
static enum drm_mode_status vlv_dsi_mode_valid(struct drm_connector *connector,
|
||||
struct drm_display_mode *mode)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(connector->dev);
|
||||
|
||||
if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915)) {
|
||||
enum drm_mode_status status;
|
||||
|
||||
status = intel_cpu_transcoder_mode_valid(i915, mode);
|
||||
if (status != MODE_OK)
|
||||
return status;
|
||||
}
|
||||
|
||||
return intel_dsi_mode_valid(connector, mode);
|
||||
}
|
||||
|
||||
static const struct drm_connector_helper_funcs intel_dsi_connector_helper_funcs = {
|
||||
.get_modes = intel_dsi_get_modes,
|
||||
.mode_valid = intel_dsi_mode_valid,
|
||||
.mode_valid = vlv_dsi_mode_valid,
|
||||
.atomic_check = intel_digital_connector_atomic_check,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue