diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_crt.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_crt.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index 68f2fb89ece3..2e0fd9927db2 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -344,51 +344,52 @@ intel_crt_mode_valid(struct drm_connector *connector, | |||
344 | return MODE_OK; | 344 | return MODE_OK; |
345 | } | 345 | } |
346 | 346 | ||
347 | static bool intel_crt_compute_config(struct intel_encoder *encoder, | 347 | static int intel_crt_compute_config(struct intel_encoder *encoder, |
348 | struct intel_crtc_state *pipe_config, | 348 | struct intel_crtc_state *pipe_config, |
349 | struct drm_connector_state *conn_state) | 349 | struct drm_connector_state *conn_state) |
350 | { | 350 | { |
351 | struct drm_display_mode *adjusted_mode = | 351 | struct drm_display_mode *adjusted_mode = |
352 | &pipe_config->base.adjusted_mode; | 352 | &pipe_config->base.adjusted_mode; |
353 | 353 | ||
354 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) | 354 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) |
355 | return false; | 355 | return -EINVAL; |
356 | 356 | ||
357 | pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; | 357 | pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; |
358 | return true; | 358 | |
359 | return 0; | ||
359 | } | 360 | } |
360 | 361 | ||
361 | static bool pch_crt_compute_config(struct intel_encoder *encoder, | 362 | static int pch_crt_compute_config(struct intel_encoder *encoder, |
362 | struct intel_crtc_state *pipe_config, | 363 | struct intel_crtc_state *pipe_config, |
363 | struct drm_connector_state *conn_state) | 364 | struct drm_connector_state *conn_state) |
364 | { | 365 | { |
365 | struct drm_display_mode *adjusted_mode = | 366 | struct drm_display_mode *adjusted_mode = |
366 | &pipe_config->base.adjusted_mode; | 367 | &pipe_config->base.adjusted_mode; |
367 | 368 | ||
368 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) | 369 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) |
369 | return false; | 370 | return -EINVAL; |
370 | 371 | ||
371 | pipe_config->has_pch_encoder = true; | 372 | pipe_config->has_pch_encoder = true; |
372 | pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; | 373 | pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; |
373 | 374 | ||
374 | return true; | 375 | return 0; |
375 | } | 376 | } |
376 | 377 | ||
377 | static bool hsw_crt_compute_config(struct intel_encoder *encoder, | 378 | static int hsw_crt_compute_config(struct intel_encoder *encoder, |
378 | struct intel_crtc_state *pipe_config, | 379 | struct intel_crtc_state *pipe_config, |
379 | struct drm_connector_state *conn_state) | 380 | struct drm_connector_state *conn_state) |
380 | { | 381 | { |
381 | struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); | 382 | struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); |
382 | struct drm_display_mode *adjusted_mode = | 383 | struct drm_display_mode *adjusted_mode = |
383 | &pipe_config->base.adjusted_mode; | 384 | &pipe_config->base.adjusted_mode; |
384 | 385 | ||
385 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) | 386 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) |
386 | return false; | 387 | return -EINVAL; |
387 | 388 | ||
388 | /* HSW/BDW FDI limited to 4k */ | 389 | /* HSW/BDW FDI limited to 4k */ |
389 | if (adjusted_mode->crtc_hdisplay > 4096 || | 390 | if (adjusted_mode->crtc_hdisplay > 4096 || |
390 | adjusted_mode->crtc_hblank_start > 4096) | 391 | adjusted_mode->crtc_hblank_start > 4096) |
391 | return false; | 392 | return -EINVAL; |
392 | 393 | ||
393 | pipe_config->has_pch_encoder = true; | 394 | pipe_config->has_pch_encoder = true; |
394 | pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; | 395 | pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; |
@@ -397,7 +398,7 @@ static bool hsw_crt_compute_config(struct intel_encoder *encoder, | |||
397 | if (HAS_PCH_LPT(dev_priv)) { | 398 | if (HAS_PCH_LPT(dev_priv)) { |
398 | if (pipe_config->bw_constrained && pipe_config->pipe_bpp < 24) { | 399 | if (pipe_config->bw_constrained && pipe_config->pipe_bpp < 24) { |
399 | DRM_DEBUG_KMS("LPT only supports 24bpp\n"); | 400 | DRM_DEBUG_KMS("LPT only supports 24bpp\n"); |
400 | return false; | 401 | return -EINVAL; |
401 | } | 402 | } |
402 | 403 | ||
403 | pipe_config->pipe_bpp = 24; | 404 | pipe_config->pipe_bpp = 24; |
@@ -406,7 +407,7 @@ static bool hsw_crt_compute_config(struct intel_encoder *encoder, | |||
406 | /* FDI must always be 2.7 GHz */ | 407 | /* FDI must always be 2.7 GHz */ |
407 | pipe_config->port_clock = 135000 * 2; | 408 | pipe_config->port_clock = 135000 * 2; |
408 | 409 | ||
409 | return true; | 410 | return 0; |
410 | } | 411 | } |
411 | 412 | ||
412 | static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector) | 413 | static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector) |