diff options
author | Dave Airlie <airlied@linux.ie> | 2009-04-22 04:52:14 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-06-12 01:00:01 -0400 |
commit | 7ff145593d808a371924652c8d6a15fb75ce2250 (patch) | |
tree | 47f9d2d43f9ee99238e398a2ce858b4f5b83e073 /drivers | |
parent | c5c07550d41abe86d109430e718f2007113031f8 (diff) |
drm/i915: duplicate desired mode for use by fbcon.
duplicate the mode into fbcon storage, so when we free modes later
we don't just lose this.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_fb.c | 16 |
2 files changed, 14 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index b32a51f2a91d..028f5b66e3d8 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -2310,6 +2310,8 @@ static void intel_crtc_destroy(struct drm_crtc *crtc) | |||
2310 | { | 2310 | { |
2311 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 2311 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
2312 | 2312 | ||
2313 | if (intel_crtc->mode_set.mode) | ||
2314 | drm_mode_destroy(crtc->dev, intel_crtc->mode_set.mode); | ||
2313 | drm_crtc_cleanup(crtc); | 2315 | drm_crtc_cleanup(crtc); |
2314 | kfree(intel_crtc); | 2316 | kfree(intel_crtc); |
2315 | } | 2317 | } |
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index cbd2ba828c72..0ecf6b76a401 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c | |||
@@ -674,8 +674,12 @@ static int intelfb_multi_fb_probe_crtc(struct drm_device *dev, struct drm_crtc * | |||
674 | par->crtc_ids[0] = crtc->base.id; | 674 | par->crtc_ids[0] = crtc->base.id; |
675 | 675 | ||
676 | modeset->num_connectors = conn_count; | 676 | modeset->num_connectors = conn_count; |
677 | if (modeset->mode != modeset->crtc->desired_mode) | 677 | if (modeset->crtc->desired_mode) { |
678 | modeset->mode = modeset->crtc->desired_mode; | 678 | if (modeset->mode) |
679 | drm_mode_destroy(dev, modeset->mode); | ||
680 | modeset->mode = drm_mode_duplicate(dev, | ||
681 | modeset->crtc->desired_mode); | ||
682 | } | ||
679 | 683 | ||
680 | par->crtc_count = 1; | 684 | par->crtc_count = 1; |
681 | 685 | ||
@@ -824,8 +828,12 @@ static int intelfb_single_fb_probe(struct drm_device *dev) | |||
824 | par->crtc_ids[crtc_count++] = crtc->base.id; | 828 | par->crtc_ids[crtc_count++] = crtc->base.id; |
825 | 829 | ||
826 | modeset->num_connectors = conn_count; | 830 | modeset->num_connectors = conn_count; |
827 | if (modeset->mode != modeset->crtc->desired_mode) | 831 | if (modeset->crtc->desired_mode) { |
828 | modeset->mode = modeset->crtc->desired_mode; | 832 | if (modeset->mode) |
833 | drm_mode_destroy(dev, modeset->mode); | ||
834 | modeset->mode = drm_mode_duplicate(dev, | ||
835 | modeset->crtc->desired_mode); | ||
836 | } | ||
829 | } | 837 | } |
830 | par->crtc_count = crtc_count; | 838 | par->crtc_count = crtc_count; |
831 | 839 | ||