aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_crt.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2019-01-17 18:20:10 -0500
committerDave Airlie <airlied@redhat.com>2019-01-17 18:31:28 -0500
commitf164a94c2c87752caeb1a3cbe068c440e7f7921f (patch)
treee914296ef0ce1df83e506a12bf4306d5aa468b24 /drivers/gpu/drm/i915/intel_crt.c
parentb122153c7198e35fcb981ca9efd63b0df8ef3eab (diff)
parent94520db52fc0e931327bb77fe79a952a0e9dd2b0 (diff)
Merge tag 'drm-misc-next-2019-01-16' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next for 5.1: UAPI Changes: - New fourcc identifier for ARM Framebuffer Compression v1.3 Cross-subsystem Changes: Core Changes: - Reorganisation of drm_device and drm_framebuffer headers - Cleanup of the drmP inclusion - Fix leaks in the fb-helpers - Allow for depth different from bpp in fb-helper fbdev emulation - Remove drm_mode_object from drm_display_mode Driver Changes: - Add reflection properties to rockchip - a bunch of fixes for virtio - a bunch of fixes for dp_mst and drivers using it, and introduction of a new refcounting scheme - Convertion of bochs to atomic and generic fbdev emulation - Allow meson to remove the firmware framebuffers [airlied: patch rcar-du to add drm_modes.h] Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190116200428.u2n4jbk4mzza7n6e@flea
Diffstat (limited to 'drivers/gpu/drm/i915/intel_crt.c')
-rw-r--r--drivers/gpu/drm/i915/intel_crt.c35
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
347static bool intel_crt_compute_config(struct intel_encoder *encoder, 347static 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
361static bool pch_crt_compute_config(struct intel_encoder *encoder, 362static 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
377static bool hsw_crt_compute_config(struct intel_encoder *encoder, 378static 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
412static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector) 413static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)