aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_fbdev.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2014-02-12 18:03:40 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-02-13 05:52:44 -0500
commit02f5eebb63ad52c832a81109d68718df6cb1155e (patch)
tree6550b15fe54668b182736d330db1cb3d3889f010 /drivers/gpu/drm/i915/intel_fbdev.c
parentb45a67157a609da83f6b2e6803296c5ccb2f8c8d (diff)
drm/i915: don't preserve inherited configs with nothing on v2
It can be corrected later and may be what was actually desired, but generally isn't, so if we find nothing is enabled, let the core DRM fb helper figure something out. v2: free the array too (Jesse) Note that this also undoes any changes in case we bail out due to hw cloning. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_fbdev.c')
-rw-r--r--drivers/gpu/drm/i915/intel_fbdev.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index 25d2746fe695..19be4bfbcc59 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -286,7 +286,17 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,
286 struct drm_display_mode **modes, 286 struct drm_display_mode **modes,
287 bool *enabled, int width, int height) 287 bool *enabled, int width, int height)
288{ 288{
289 struct drm_device *dev = fb_helper->dev;
289 int i, j; 290 int i, j;
291 bool *save_enabled;
292 bool any_enabled = false;
293
294 save_enabled = kcalloc(dev->mode_config.num_connector, sizeof(bool),
295 GFP_KERNEL);
296 if (!save_enabled)
297 return false;
298
299 memcpy(save_enabled, enabled, dev->mode_config.num_connector);
290 300
291 for (i = 0; i < fb_helper->connector_count; i++) { 301 for (i = 0; i < fb_helper->connector_count; i++) {
292 struct drm_fb_helper_connector *fb_conn; 302 struct drm_fb_helper_connector *fb_conn;
@@ -318,8 +328,10 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,
318 * match the BIOS. 328 * match the BIOS.
319 */ 329 */
320 for (j = 0; j < fb_helper->connector_count; j++) { 330 for (j = 0; j < fb_helper->connector_count; j++) {
321 if (crtcs[j] == new_crtc) 331 if (crtcs[j] == new_crtc) {
322 return false; 332 any_enabled = false;
333 goto out;
334 }
323 } 335 }
324 336
325 DRM_DEBUG_KMS("looking for cmdline mode on connector %d\n", 337 DRM_DEBUG_KMS("looking for cmdline mode on connector %d\n",
@@ -359,8 +371,18 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,
359 drm_get_connector_name(connector), 371 drm_get_connector_name(connector),
360 encoder->crtc->base.id, 372 encoder->crtc->base.id,
361 modes[i]->name); 373 modes[i]->name);
374
375 any_enabled = true;
376 }
377
378out:
379 if (!any_enabled) {
380 memcpy(enabled, save_enabled, dev->mode_config.num_connector);
381 kfree(save_enabled);
382 return false;
362 } 383 }
363 384
385 kfree(save_enabled);
364 return true; 386 return true;
365} 387}
366 388