Skip to content

Commit 6f75511

Browse files
committed
Merge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel into drm-fixes
Daniel writes: Just a few small things to fix regressions, somehow all patches from Jani: - Fix dpms confusion about which platforms support intermediate modes on vga. - Revert the "ignore vbt for eDP bpc" patch, it breaks machines. This will annoy mbp retina owners again, but windows machines seem to _really_ depend upon this. We can try to quirk the mbp retinas again in 3.8 and backport the patch. - Fix connector leaks when the sdvo setup failed, resulted in an OOPS later on when trying to probe that connector (with it's encoder kfree'd already). * 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel: drm/i915: do not ignore eDP bpc settings from vbt drm/i915/sdvo: clean up connectors on intel_sdvo_init() failures drm/i915/crt: fix DPMS standby and suspend mode handling
2 parents 3697fd5 + 2f4f649 commit 6f75511

3 files changed

Lines changed: 31 additions & 4 deletions

File tree

‎drivers/gpu/drm/i915/intel_crt.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ static void intel_crt_dpms(struct drm_connector *connector, int mode)
143143
int old_dpms;
144144

145145
/* PCH platforms and VLV only support on/off. */
146-
if (INTEL_INFO(dev)->gen < 5 && mode != DRM_MODE_DPMS_ON)
146+
if (INTEL_INFO(dev)->gen >= 5 && mode != DRM_MODE_DPMS_ON)
147147
mode = DRM_MODE_DPMS_OFF;
148148

149149
if (mode == connector->dpms)

‎drivers/gpu/drm/i915/intel_display.c‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3841,6 +3841,17 @@ static bool intel_choose_pipe_bpp_dither(struct drm_crtc *crtc,
38413841
}
38423842
}
38433843

3844+
if (intel_encoder->type == INTEL_OUTPUT_EDP) {
3845+
/* Use VBT settings if we have an eDP panel */
3846+
unsigned int edp_bpc = dev_priv->edp.bpp / 3;
3847+
3848+
if (edp_bpc < display_bpc) {
3849+
DRM_DEBUG_KMS("clamping display bpc (was %d) to eDP (%d)\n", display_bpc, edp_bpc);
3850+
display_bpc = edp_bpc;
3851+
}
3852+
continue;
3853+
}
3854+
38443855
/*
38453856
* HDMI is either 12 or 8, so if the display lets 10bpc sneak
38463857
* through, clamp it down. (Note: >12bpc will be caught below.)

‎drivers/gpu/drm/i915/intel_sdvo.c‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,6 +2382,18 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, uint16_t flags)
23822382
return true;
23832383
}
23842384

2385+
static void intel_sdvo_output_cleanup(struct intel_sdvo *intel_sdvo)
2386+
{
2387+
struct drm_device *dev = intel_sdvo->base.base.dev;
2388+
struct drm_connector *connector, *tmp;
2389+
2390+
list_for_each_entry_safe(connector, tmp,
2391+
&dev->mode_config.connector_list, head) {
2392+
if (intel_attached_encoder(connector) == &intel_sdvo->base)
2393+
intel_sdvo_destroy(connector);
2394+
}
2395+
}
2396+
23852397
static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,
23862398
struct intel_sdvo_connector *intel_sdvo_connector,
23872399
int type)
@@ -2705,7 +2717,8 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob)
27052717
intel_sdvo->caps.output_flags) != true) {
27062718
DRM_DEBUG_KMS("SDVO output failed to setup on %s\n",
27072719
SDVO_NAME(intel_sdvo));
2708-
goto err;
2720+
/* Output_setup can leave behind connectors! */
2721+
goto err_output;
27092722
}
27102723

27112724
/* Only enable the hotplug irq if we need it, to work around noisy
@@ -2718,12 +2731,12 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob)
27182731

27192732
/* Set the input timing to the screen. Assume always input 0. */
27202733
if (!intel_sdvo_set_target_input(intel_sdvo))
2721-
goto err;
2734+
goto err_output;
27222735

27232736
if (!intel_sdvo_get_input_pixel_clock_range(intel_sdvo,
27242737
&intel_sdvo->pixel_clock_min,
27252738
&intel_sdvo->pixel_clock_max))
2726-
goto err;
2739+
goto err_output;
27272740

27282741
DRM_DEBUG_KMS("%s device VID/DID: %02X:%02X.%02X, "
27292742
"clock range %dMHz - %dMHz, "
@@ -2743,6 +2756,9 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob)
27432756
(SDVO_OUTPUT_TMDS1 | SDVO_OUTPUT_RGB1) ? 'Y' : 'N');
27442757
return true;
27452758

2759+
err_output:
2760+
intel_sdvo_output_cleanup(intel_sdvo);
2761+
27462762
err:
27472763
drm_encoder_cleanup(&intel_encoder->base);
27482764
i2c_del_adapter(&intel_sdvo->ddc);

0 commit comments

Comments
 (0)