rpms/kernel/devel drm-intel-next.patch, 1.5, 1.6 kernel.spec, 1.1327, 1.1328
Kristian Høgsberg
krh at fedoraproject.org
Tue Feb 24 15:12:16 UTC 2009
Author: krh
Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16208
Modified Files:
drm-intel-next.patch kernel.spec
Log Message:
* Tue Feb 24 2009 Kristian Høgsberg <krh at redhat.com>
- Pull in new round of intel KMS fixes.
drm-intel-next.patch:
Index: drm-intel-next.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/drm-intel-next.patch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- drm-intel-next.patch 13 Feb 2009 23:44:29 -0000 1.5
+++ drm-intel-next.patch 24 Feb 2009 15:11:45 -0000 1.6
@@ -16,178 +16,98 @@
# Patches follow
-commit 5eaf13a569f7b0e7884fc083cbf7e62ddcec6a8f
-Author: Kristian Høgsberg <krh at redhat.com>
-Date: Fri Feb 13 18:22:53 2009 -0500
-
- [i915] Bring PLL limits in sync with DDX values.
-
- Signed-off-by: Kristian Høgsberg <krh at redhat.com>
-
-commit b02c4adfa7c31b6679dcd4da5a66c125bac8aafe
-Author: Kristian Høgsberg <krh at redhat.com>
-Date: Fri Feb 13 17:51:11 2009 -0500
-
- [i915] Collapse identical i8xx_clock() and i9xx_clock().
-
- They used to be different. Now they're identical.
-
- Signed-off-by: Kristian Høgsberg <krh at redhat.com>
-
-commit 3435521fd84cf373c02b8e0fb9e59a75285636a4
-Author: Kristian Høgsberg <krh at redhat.com>
-Date: Fri Feb 13 17:44:12 2009 -0500
+commit 0da41c8be1590893927e26f54607f1522b802878
+Author: Chris Wilson <chris at chris-wilson.co.uk>
+Date: Thu Feb 19 14:48:22 2009 +0000
- [i915] Use spread spectrum when the bios tells us it's ok.
+ drm: Correct unbalanced drm_vblank_put() during mode setting.
- Lifted from the DDX modesetting.
+ The first time we install a mode, the vblank will be disabled for a pipe
+ and so drm_vblank_get() in drm_vblank_pre_modeset() will fail. As we
+ unconditionally call drm_vblank_put() afterwards, the vblank reference
+ counter becomes unbalanced.
- Signed-off-by: Kristian Høgsberg <krh at redhat.com>
+ Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
-commit 5e15374a3900c941bbeb5d5cedddad07aa821184
-Author: Kristian Høgsberg <krh at redhat.com>
-Date: Fri Feb 13 15:41:59 2009 -0500
-
- [i915] Add missing locking around gem operations.
-
- Pinning and setting the domains requires taking the struct mutex.
-
- Signed-off-by: Kristian Høgsberg <krh at redhat.com>
-
-commit 6c7aefedd9ebaf1146581dec54f74b29486dae56
+commit fb865c44d217cc5d75b7929d70923c2ef7cf4c45
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
-Date: Wed Feb 4 14:27:01 2009 -0800
+Date: Mon Feb 23 16:09:34 2009 -0800
- drm: set_config fixes
-
- On Wednesday, February 4, 2009 1:24 pm Jesse Barnes wrote:
- > Kristian pointed out some problems with the set_config code (switching
- > CRTCs didn't work for one) so I took a look and found a couple of problems.
- > I'm still working on the CRTC switch issue, looks like the pipes don't get
- > configured right if they're swapped, but this patch fixes some other bugs:
- > - checks possible_crtcs in the CRTC assignment loop
- > - restores previous fb in case of mode set failure
- > - checks to make sure a connector has an encoder before restoring its
- > crtc - adds a few more debug statements for finding out why a modeset is
- > occurring
- >
- > Any thoughts on this?
+ drm: disable encoders before re-routing them
- Here's an updated one that will disable unused/re-routed encoders at mode set
- time. Should fix Kristian's bug.
+ In some cases we may receive a mode config that has a different
+ CRTC<->encoder map that the current configuration. In that case, we
+ need to disable any re-routed encoders before setting the mode,
+ otherwise they may not pick up the new CRTC (if the output types are
+ incompatible for example).
- --
- Jesse Barnes, Intel Open Source Technology Center
+ Tested-by: Kristian Høgsberg <krh at bitplanet.net>
+ Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
-commit 4307cccd79e3c2b45304b28d4c629ef08d30f4a1
+commit c37e9bc6cb05f0d8aa225845941a0146296bf9bb
Author: Kristian Høgsberg <krh at redhat.com>
-Date: Tue Feb 3 15:07:02 2009 -0500
+Date: Mon Feb 16 17:01:26 2009 -0500
- Restore kernelfb mode for all crtcs.
-
- Record and restore the kernel framebuffer for all crtc on panic
- and lastclose.
+ drm: Remove noisy DRM_ERROR() debug printout.
Signed-off-by: Kristian Høgsberg <krh at redhat.com>
-commit 0e2f967303023f7f82a0963b7f7f3980d4c08f20
-Author: Roland Dreier <rdreier at cisco.com>
-Date: Fri Feb 6 17:48:09 2009 -0800
-
- drm/i915: Fix potential AB-BA deadlock in i915_gem_execbuffer()
-
- Lockdep warns that i915_gem_execbuffer() can trigger a page fault (which
- takes mmap_sem) while holding dev->struct_mutex, while drm_vm_open()
- (which is called with mmap_sem already held) takes dev->struct_mutex.
- So this is a potential AB-BA deadlock.
-
- The way that i915_gem_execbuffer() triggers a page fault is by doing
- copy_to_user() when returning new buffer offsets back to userspace;
- however there is no reason to hold the struct_mutex when doing this
- copy, since what is being copied is the contents of an array private to
- i915_gem_execbuffer() anyway. So we can fix the potential deadlock (and
- get rid of the lockdep warning) by simply moving the copy_to_user()
- outside of where struct_mutex is held.
-
- This fixes <http://bugzilla.kernel.org/show_bug.cgi?id=12491>.
-
- Reported-by: Jesse Brandeburg <jesse.brandeburg at intel.com>
- Tested-by: Jesse Brandeburg <jesse.brandeburg at intel.com>
- Signed-off-by: Roland Dreier <rolandd at cisco.com>
- Signed-off-by: Eric Anholt <eric at anholt.net>
-
-commit 42fe9ab5fc5e6249386153a7c562b596ed8e25ce
-Author: Chris Wilson <chris at chris-wilson.co.uk>
-Date: Sun Feb 8 19:08:04 2009 +0000
-
- drm/i915: refleak along pin() error path.
-
- A missing unreference if the user calls pin() a second time on a pinned
- buffer.
-
- Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
- Signed-off-by: Eric Anholt <eric at anholt.net>
-
-commit db4cdf6345df24e43dc46306a6759060c4901d61
-Author: Chris Wilson <chris at chris-wilson.co.uk>
-Date: Sun Feb 8 19:07:51 2009 +0000
+commit 7652afdd9e8ceaa92f34ad347be404b3903ff30f
+Author: Jesse Barnes <jbarnes at virtuousgeek.org>
+Date: Mon Feb 23 15:36:41 2009 -0800
- drm/i915: hold mutex for unreference() in i915_gem_tiling.c
+ drm: Fix ordering of bit fields in EDID structure leading huge vsync values.
- Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
- Signed-off-by: Eric Anholt <eric at anholt.net>
+ Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
+ Reviewed-by: Eric Anholt <eric at anholt.net>
-commit f467a5c7200e156d8e253e6f2bbcf80e6b7187d9
-Author: Chris Wilson <chris at chris-wilson.co.uk>
-Date: Fri Feb 6 16:55:20 2009 +0000
+commit 96dc838f0b8c585b71144d03cf575005c3365c50
+Author: Linus Torvalds <torvalds at linux-foundation.org>
+Date: Mon Feb 23 08:44:33 2009 -0800
- drm/i915: Cleanup trivial leak on execbuffer error path.
-
- Also spotted by Owain Ainsworth.
+ drm: Fix shifts of EDID vsync offset/width fields.
- Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
- Signed-off-by: Eric Anholt <eric at anholt.net>
+ Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
+ Reviewed-by: Eric Anholt <eric at anholt.net>
-commit d46d509398b3690ababd05bea6b3bcce52c37780
-Author: Chris Wilson <chris at chris-wilson.co.uk>
-Date: Mon Feb 9 11:31:41 2009 +0000
+commit de03d60e1366bc9270b3cbcd8261c39b7f711ce0
+Author: Jesse Barnes <jbarnes at virtuousgeek.org>
+Date: Mon Feb 23 15:36:43 2009 -0800
- drm: Free the object ref on error.
+ i915: suspend/resume interrupt state
- Ensure that the object is unreferenced if we fail to allocate during
- drm_gem_flink_ioctl().
+ In the KMS case, enter/leavevt won't fix up the interrupt handler for
+ us, so we need to do it at suspend/resume time. Make sure we don't fail
+ the resume if the chip is hung either.
- Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
- Signed-off-by: Eric Anholt <eric at anholt.net>
+ Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
-commit 821da41f85b1816e9f7d811a4b9733a07a3585a3
-Author: Chris Wilson <chris at chris-wilson.co.uk>
-Date: Mon Feb 9 11:31:41 2009 +0000
+commit 37732382db80631517ee62953ef44fdcae8a8cee
+Author: Jesse Barnes <jbarnes at virtuousgeek.org>
+Date: Mon Feb 23 15:36:42 2009 -0800
- drm: Potential use-after-free on error path.
+ drm/i915: handle bogus VBT panel timing
- Remove the member from the hash table before we free the structure!
+ We've seen cases in the wild where the VBT sync data is wrong, so add
+ some code to fix it up in that case, taking care to make sure that the
+ total is greater than the sync end.
- Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
- Signed-off-by: Eric Anholt <eric at anholt.net>
+ Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
-commit cf1573b0f0e79cb0808596589578a4ca60081730
-Author: Tobias Klauser <tklauser at distanz.ch>
-Date: Mon Feb 9 22:02:42 2009 +0100
+commit 02b4f6cbd548f793cf971440d67c7d263ef5c8a1
+Author: Jesse Barnes <jbarnes at virtuousgeek.org>
+Date: Mon Feb 23 15:36:40 2009 -0800
- drm/i915: Storage class should be before const qualifier
-
- The C99 specification states in section 6.11.5:
+ drm/i915: remove PLL debugging messages
- The placement of a storage-class specifier other than at the beginning
- of the declaration specifiers in a declaration is an obsolescent
- feature.
+ These are normal; we walk through different values looking for the right
+ one, so why flood the screen with messages?
- Signed-off-by: Tobias Klauser <tklauser at distanz.ch>
- Signed-off-by: Eric Anholt <eric at anholt.net>
+ Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
+ Reviewed-by: Eric Anholt <eric at anholt.net>
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
-index 964c5eb..40c60de 100644
+index 733028b..1c3a8c5 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -452,6 +452,59 @@ static void drm_setup_crtcs(struct drm_device *dev)
@@ -250,16 +170,16 @@
/**
* drm_crtc_set_mode - set a mode
* @crtc: CRTC to program
-@@ -489,6 +542,8 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
- if (!crtc->enabled)
- return true;
+@@ -547,6 +600,8 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
+ encoder_funcs->prepare(encoder);
+ }
+ drm_crtc_prepare_encoders(dev);
+
- if (old_fb && crtc->fb) {
- depth_changed = (old_fb->depth != crtc->fb->depth);
- bpp_changed = (old_fb->bits_per_pixel !=
-@@ -615,7 +670,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
+ crtc_funcs->prepare(crtc);
+
+ /* Set up the DPLL and any encoders state that needs to adjust or depend
+@@ -617,7 +672,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
struct drm_device *dev;
struct drm_crtc **save_crtcs, *new_crtc;
struct drm_encoder **save_encoders, *new_encoder;
@@ -268,7 +188,7 @@
bool save_enabled;
bool mode_changed = false;
bool fb_changed = false;
-@@ -666,9 +721,10 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
+@@ -668,9 +723,10 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
* and then just flip_or_move it */
if (set->crtc->fb != set->fb) {
/* If we have no fb then treat it as a full mode set */
@@ -281,7 +201,7 @@
set->crtc->fb->bits_per_pixel) ||
set->fb->depth != set->crtc->fb->depth)
fb_changed = true;
-@@ -680,7 +736,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
+@@ -682,7 +738,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
fb_changed = true;
if (set->mode && !drm_mode_equal(set->mode, &set->crtc->mode)) {
@@ -290,7 +210,7 @@
drm_mode_debug_printmodeline(&set->crtc->mode);
drm_mode_debug_printmodeline(set->mode);
mode_changed = true;
-@@ -706,6 +762,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
+@@ -708,6 +764,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
}
if (new_encoder != connector->encoder) {
@@ -298,7 +218,7 @@
mode_changed = true;
connector->encoder = new_encoder;
}
-@@ -732,10 +789,20 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
+@@ -734,10 +791,20 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
if (set->connectors[ro] == connector)
new_crtc = set->crtc;
}
@@ -319,531 +239,143 @@
}
/* mode_set_base is not a required function */
-@@ -774,9 +841,11 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
+@@ -781,6 +848,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
fail_set_mode:
set->crtc->enabled = save_enabled;
+ set->crtc->fb = old_fb;
count = 0;
- list_for_each_entry(connector, &dev->mode_config.connector_list, head)
-- connector->encoder->crtc = save_crtcs[count++];
-+ if (connector->encoder)
-+ connector->encoder->crtc = save_crtcs[count++];
- fail_no_encoder:
- kfree(save_crtcs);
- count = 0;
-diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
-index 6915fb8..e5a8ebf 100644
---- a/drivers/gpu/drm/drm_gem.c
-+++ b/drivers/gpu/drm/drm_gem.c
-@@ -104,8 +104,8 @@ drm_gem_init(struct drm_device *dev)
-
- if (drm_mm_init(&mm->offset_manager, DRM_FILE_PAGE_OFFSET_START,
- DRM_FILE_PAGE_OFFSET_SIZE)) {
-- drm_free(mm, sizeof(struct drm_gem_mm), DRM_MEM_MM);
- drm_ht_remove(&mm->offset_hash);
-+ drm_free(mm, sizeof(struct drm_gem_mm), DRM_MEM_MM);
- return -ENOMEM;
- }
-
-@@ -295,8 +295,10 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
- return -EBADF;
-
- again:
-- if (idr_pre_get(&dev->object_name_idr, GFP_KERNEL) == 0)
-- return -ENOMEM;
-+ if (idr_pre_get(&dev->object_name_idr, GFP_KERNEL) == 0) {
-+ ret = -ENOMEM;
-+ goto err;
-+ }
-
- spin_lock(&dev->object_name_lock);
- if (obj->name) {
-@@ -310,12 +312,8 @@ again:
- if (ret == -EAGAIN)
- goto again;
-
-- if (ret != 0) {
-- mutex_lock(&dev->struct_mutex);
-- drm_gem_object_unreference(obj);
-- mutex_unlock(&dev->struct_mutex);
-- return ret;
-- }
-+ if (ret != 0)
-+ goto err;
-
- /*
- * Leave the reference from the lookup around as the
-@@ -324,6 +322,12 @@ again:
- args->name = (uint64_t) obj->name;
-
- return 0;
-+
-+err:
-+ mutex_lock(&dev->struct_mutex);
-+ drm_gem_object_unreference(obj);
-+ mutex_unlock(&dev->struct_mutex);
-+ return ret;
- }
-
- /**
-diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
-index 7325363..135a08f 100644
---- a/drivers/gpu/drm/i915/i915_drv.h
-+++ b/drivers/gpu/drm/i915/i915_drv.h
-@@ -184,6 +184,8 @@ typedef struct drm_i915_private {
- unsigned int lvds_dither:1;
- unsigned int lvds_vbt:1;
- unsigned int int_crt_support:1;
-+ unsigned int lvds_use_ssc:1;
-+ int lvds_ssc_freq;
-
- struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */
- int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */
-diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
-index 8185766..ff0d94d 100644
---- a/drivers/gpu/drm/i915/i915_gem.c
-+++ b/drivers/gpu/drm/i915/i915_gem.c
-@@ -2480,13 +2480,15 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
- if (dev_priv->mm.wedged) {
- DRM_ERROR("Execbuf while wedged\n");
- mutex_unlock(&dev->struct_mutex);
-- return -EIO;
-+ ret = -EIO;
-+ goto pre_mutex_err;
- }
-
- if (dev_priv->mm.suspended) {
- DRM_ERROR("Execbuf while VT-switched.\n");
- mutex_unlock(&dev->struct_mutex);
+ list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
+ if (!connector->encoder)
+diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
+index 5a4d324..e902b1c 100644
+--- a/drivers/gpu/drm/drm_edid.c
++++ b/drivers/gpu/drm/drm_edid.c
+@@ -320,10 +320,10 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
+ mode->htotal = mode->hdisplay + ((pt->hblank_hi << 8) | pt->hblank_lo);
+
+ mode->vdisplay = (pt->vactive_hi << 8) | pt->vactive_lo;
+- mode->vsync_start = mode->vdisplay + ((pt->vsync_offset_hi << 8) |
++ mode->vsync_start = mode->vdisplay + ((pt->vsync_offset_hi << 4) |
+ pt->vsync_offset_lo);
+ mode->vsync_end = mode->vsync_start +
+- ((pt->vsync_pulse_width_hi << 8) |
++ ((pt->vsync_pulse_width_hi << 4) |
+ pt->vsync_pulse_width_lo);
+ mode->vtotal = mode->vdisplay + ((pt->vblank_hi << 8) | pt->vblank_lo);
+
+diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
+index 3795dbc..93e677a 100644
+--- a/drivers/gpu/drm/drm_irq.c
++++ b/drivers/gpu/drm/drm_irq.c
+@@ -435,6 +435,8 @@ EXPORT_SYMBOL(drm_vblank_get);
+ */
+ void drm_vblank_put(struct drm_device *dev, int crtc)
+ {
++ BUG_ON (atomic_read (&dev->vblank_refcount[crtc]) == 0);
++
+ /* Last user schedules interrupt disable */
+ if (atomic_dec_and_test(&dev->vblank_refcount[crtc]))
+ mod_timer(&dev->vblank_disable_timer, jiffies + 5*DRM_HZ);
+@@ -460,8 +462,9 @@ void drm_vblank_pre_modeset(struct drm_device *dev, int crtc)
+ * so that interrupts remain enabled in the interim.
+ */
+ if (!dev->vblank_inmodeset[crtc]) {
+- dev->vblank_inmodeset[crtc] = 1;
+- drm_vblank_get(dev, crtc);
++ dev->vblank_inmodeset[crtc] = 0x1;
++ if (drm_vblank_get(dev, crtc) == 0)
++ dev->vblank_inmodeset[crtc] |= 0x2;
+ }
+ }
+ EXPORT_SYMBOL(drm_vblank_pre_modeset);
+@@ -473,9 +476,12 @@ void drm_vblank_post_modeset(struct drm_device *dev, int crtc)
+ if (dev->vblank_inmodeset[crtc]) {
+ spin_lock_irqsave(&dev->vbl_lock, irqflags);
+ dev->vblank_disable_allowed = 1;
+- dev->vblank_inmodeset[crtc] = 0;
+ spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
+- drm_vblank_put(dev, crtc);
++
++ if (dev->vblank_inmodeset[crtc] & 0x2)
++ drm_vblank_put(dev, crtc);
++
++ dev->vblank_inmodeset[crtc] = 0;
+ }
+ }
+ EXPORT_SYMBOL(drm_vblank_post_modeset);
+diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
+index 0692622..b293ef0 100644
+--- a/drivers/gpu/drm/i915/i915_drv.c
++++ b/drivers/gpu/drm/i915/i915_drv.c
+@@ -68,9 +68,11 @@ static int i915_suspend(struct drm_device *dev, pm_message_t state)
+ i915_save_state(dev);
+
+ /* If KMS is active, we do the leavevt stuff here */
+- if (drm_core_check_feature(dev, DRIVER_MODESET) && i915_gem_idle(dev)) {
+- dev_err(&dev->pdev->dev, "GEM idle failed, aborting suspend\n");
- return -EBUSY;
-+ ret = -EBUSY;
-+ goto pre_mutex_err;
++ if (drm_core_check_feature(dev, DRIVER_MODESET)) {
++ if (i915_gem_idle(dev))
++ dev_err(&dev->pdev->dev,
++ "GEM idle failed, resume may fail\n");
++ drm_irq_uninstall(dev);
}
- /* Look up object handles */
-@@ -2632,15 +2634,6 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
-
- i915_verify_inactive(dev, __FILE__, __LINE__);
-
-- /* Copy the new buffer offsets back to the user's exec list. */
-- ret = copy_to_user((struct drm_i915_relocation_entry __user *)
-- (uintptr_t) args->buffers_ptr,
-- exec_list,
-- sizeof(*exec_list) * args->buffer_count);
-- if (ret)
-- DRM_ERROR("failed to copy %d exec entries "
-- "back to user (%d)\n",
-- args->buffer_count, ret);
- err:
- for (i = 0; i < pinned; i++)
- i915_gem_object_unpin(object_list[i]);
-@@ -2650,6 +2643,18 @@ err:
-
- mutex_unlock(&dev->struct_mutex);
-
-+ if (!ret) {
-+ /* Copy the new buffer offsets back to the user's exec list. */
-+ ret = copy_to_user((struct drm_i915_relocation_entry __user *)
-+ (uintptr_t) args->buffers_ptr,
-+ exec_list,
-+ sizeof(*exec_list) * args->buffer_count);
-+ if (ret)
-+ DRM_ERROR("failed to copy %d exec entries "
-+ "back to user (%d)\n",
-+ args->buffer_count, ret);
-+ }
-+
- pre_mutex_err:
- drm_free(object_list, sizeof(*object_list) * args->buffer_count,
- DRM_MEM_DRIVER);
-@@ -2753,6 +2758,7 @@ i915_gem_pin_ioctl(struct drm_device *dev, void *data,
- if (obj_priv->pin_filp != NULL && obj_priv->pin_filp != file_priv) {
- DRM_ERROR("Already pinned in i915_gem_pin_ioctl(): %d\n",
- args->handle);
-+ drm_gem_object_unreference(obj);
+ intel_opregion_free(dev);
+@@ -108,6 +110,8 @@ static int i915_resume(struct drm_device *dev)
+ if (ret != 0)
+ ret = -1;
mutex_unlock(&dev->struct_mutex);
- return -EINVAL;
- }
-diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c
-index fa1685c..7fb4191 100644
---- a/drivers/gpu/drm/i915/i915_gem_tiling.c
-+++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
-@@ -299,9 +299,8 @@ i915_gem_set_tiling(struct drm_device *dev, void *data,
- }
- obj_priv->stride = args->stride;
-
-- mutex_unlock(&dev->struct_mutex);
--
- drm_gem_object_unreference(obj);
-+ mutex_unlock(&dev->struct_mutex);
-
- return 0;
- }
-@@ -340,9 +339,8 @@ i915_gem_get_tiling(struct drm_device *dev, void *data,
- DRM_ERROR("unknown tiling mode\n");
++
++ drm_irq_install(dev);
}
-- mutex_unlock(&dev->struct_mutex);
--
- drm_gem_object_unreference(obj);
-+ mutex_unlock(&dev->struct_mutex);
-
- return 0;
- }
+ return ret;
+diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
+index 25b3374..f105959 100644
+--- a/drivers/gpu/drm/i915/i915_gem.c
++++ b/drivers/gpu/drm/i915/i915_gem.c
+@@ -3545,7 +3545,6 @@ i915_gem_phys_pwrite(struct drm_device *dev, struct drm_gem_object *obj,
+ user_data = (char __user *) (uintptr_t) args->data_ptr;
+ obj_addr = obj_priv->phys_obj->handle->vaddr + args->offset;
+
+- DRM_ERROR("obj_addr %p, %lld\n", obj_addr, args->size);
+ ret = copy_from_user(obj_addr, user_data, args->size);
+ if (ret)
+ return -EFAULT;
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
-index 4ca82a0..65be30d 100644
+index 65be30d..fc28e2b 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
-@@ -135,6 +135,14 @@ parse_general_features(struct drm_i915_private *dev_priv,
- if (general) {
- dev_priv->int_tv_support = general->int_tv_support;
- dev_priv->int_crt_support = general->int_crt_support;
-+ dev_priv->lvds_use_ssc = general->enable_ssc;
-+
-+ if (dev_priv->lvds_use_ssc) {
-+ if (IS_I855(dev_priv->dev))
-+ dev_priv->lvds_ssc_freq = general->ssc_freq ? 66 : 48;
-+ else
-+ dev_priv->lvds_ssc_freq = general->ssc_freq ? 100 : 96;
-+ }
- }
- }
+@@ -111,6 +111,12 @@ parse_panel_data(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
+ panel_fixed_mode->clock = dvo_timing->clock * 10;
+ panel_fixed_mode->type = DRM_MODE_TYPE_PREFERRED;
+
++ /* Some VBTs have bogus h/vtotal values */
++ if (panel_fixed_mode->hsync_end > panel_fixed_mode->htotal)
++ panel_fixed_mode->htotal = panel_fixed_mode->hsync_end + 1;
++ if (panel_fixed_mode->vsync_end > panel_fixed_mode->vtotal)
++ panel_fixed_mode->vtotal = panel_fixed_mode->vsync_end + 1;
++
+ drm_mode_set_name(panel_fixed_mode);
+ dev_priv->vbt_mode = panel_fixed_mode;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
-index bbdd729..2daf989 100644
+index 65b635c..a283427 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
-@@ -90,12 +90,12 @@ typedef struct {
- #define I9XX_DOT_MAX 400000
- #define I9XX_VCO_MIN 1400000
- #define I9XX_VCO_MAX 2800000
--#define I9XX_N_MIN 3
--#define I9XX_N_MAX 8
-+#define I9XX_N_MIN 1
-+#define I9XX_N_MAX 6
- #define I9XX_M_MIN 70
- #define I9XX_M_MAX 120
- #define I9XX_M1_MIN 10
--#define I9XX_M1_MAX 20
-+#define I9XX_M1_MAX 22
- #define I9XX_M2_MIN 5
- #define I9XX_M2_MAX 9
- #define I9XX_P_SDVO_DAC_MIN 5
-@@ -189,19 +189,7 @@ static const intel_limit_t *intel_limit(struct drm_crtc *crtc)
- return limit;
- }
-
--/** Derive the pixel clock for the given refclk and divisors for 8xx chips. */
--
--static void i8xx_clock(int refclk, intel_clock_t *clock)
--{
-- clock->m = 5 * (clock->m1 + 2) + (clock->m2 + 2);
-- clock->p = clock->p1 * clock->p2;
-- clock->vco = refclk * clock->m / (clock->n + 2);
-- clock->dot = clock->vco / clock->p;
--}
--
--/** Derive the pixel clock for the given refclk and divisors for 9xx chips. */
--
--static void i9xx_clock(int refclk, intel_clock_t *clock)
-+static void intel_clock(int refclk, intel_clock_t *clock)
- {
- clock->m = 5 * (clock->m1 + 2) + (clock->m2 + 2);
- clock->p = clock->p1 * clock->p2;
-@@ -209,15 +197,6 @@ static void i9xx_clock(int refclk, intel_clock_t *clock)
- clock->dot = clock->vco / clock->p;
- }
-
--static void intel_clock(struct drm_device *dev, int refclk,
-- intel_clock_t *clock)
--{
-- if (IS_I9XX(dev))
-- i9xx_clock (refclk, clock);
-- else
-- i8xx_clock (refclk, clock);
--}
--
- /**
- * Returns whether any output on the specified pipe is of the specified type
- */
-@@ -238,7 +217,7 @@ bool intel_pipe_has_type (struct drm_crtc *crtc, int type)
+@@ -217,7 +217,7 @@ bool intel_pipe_has_type (struct drm_crtc *crtc, int type)
return false;
}
--#define INTELPllInvalid(s) { /* ErrorF (s) */; return false; }
-+#define INTELPllInvalid(s) do { DRM_DEBUG(s); return false; } while (0)
+-#define INTELPllInvalid(s) do { DRM_DEBUG(s); return false; } while (0)
++#define INTELPllInvalid(s) do { /* DRM_DEBUG(s); */ return false; } while (0)
/**
* Returns whether the given set of divisors are valid for a given refclk with
* the given connectors.
-@@ -318,7 +297,7 @@ static bool intel_find_best_PLL(struct drm_crtc *crtc, int target,
- clock.p1 <= limit->p1.max; clock.p1++) {
- int this_err;
-
-- intel_clock(dev, refclk, &clock);
-+ intel_clock(refclk, &clock);
-
- if (!intel_PLL_is_valid(crtc, &clock))
- continue;
-@@ -390,10 +369,14 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
- BUG();
- }
-
-- if (i915_gem_object_pin(intel_fb->obj, alignment))
-+ mutex_lock(&dev->struct_mutex);
-+ if (i915_gem_object_pin(intel_fb->obj, alignment)) {
-+ mutex_unlock(&dev->struct_mutex);
- return;
-+ }
-
- i915_gem_object_set_to_gtt_domain(intel_fb->obj, 1);
-+ mutex_unlock(&dev->struct_mutex);
-
- Start = obj_priv->gtt_offset;
- Offset = y * crtc->fb->pitch + x * (crtc->fb->bits_per_pixel / 8);
-@@ -437,8 +420,10 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
- intel_wait_for_vblank(dev);
-
- if (old_fb) {
-+ mutex_lock(&dev->struct_mutex);
- intel_fb = to_intel_framebuffer(old_fb);
- i915_gem_object_unpin(intel_fb->obj);
-+ mutex_unlock(&dev->struct_mutex);
- }
-
- if (!dev->primary->master)
-@@ -732,7 +717,7 @@ static void intel_crtc_mode_set(struct drm_crtc *crtc,
- int dspsize_reg = (pipe == 0) ? DSPASIZE : DSPBSIZE;
- int dsppos_reg = (pipe == 0) ? DSPAPOS : DSPBPOS;
- int pipesrc_reg = (pipe == 0) ? PIPEASRC : PIPEBSRC;
-- int refclk;
-+ int refclk, num_outputs = 0;
- intel_clock_t clock;
- u32 dpll = 0, fp = 0, dspcntr, pipeconf;
- bool ok, is_sdvo = false, is_dvo = false;
-@@ -768,9 +753,14 @@ static void intel_crtc_mode_set(struct drm_crtc *crtc,
- is_crt = true;
- break;
- }
-+
-+ num_outputs++;
- }
-
-- if (IS_I9XX(dev)) {
-+ if (is_lvds && dev_priv->lvds_use_ssc && num_outputs < 2) {
-+ refclk = dev_priv->lvds_ssc_freq * 1000;
-+ DRM_DEBUG("using SSC reference clock of %d MHz\n", refclk / 1000);
-+ } else if (IS_I9XX(dev)) {
- refclk = 96000;
- } else {
- refclk = 48000;
-@@ -782,6 +772,9 @@ static void intel_crtc_mode_set(struct drm_crtc *crtc,
- return;
- }
-
-+ DRM_DEBUG("setting mode on crtc %d, is_lvds: %s\n",
-+ crtc->base.id, is_lvds ? "true" : "false");
-+
- fp = clock.n << 16 | clock.m1 << 8 | clock.m2;
-
- dpll = DPLL_VGA_MODE_DIS;
-@@ -829,11 +822,14 @@ static void intel_crtc_mode_set(struct drm_crtc *crtc,
- }
- }
-
-- if (is_tv) {
-+ if (is_sdvo && is_tv)
-+ dpll |= PLL_REF_INPUT_TVCLKINBC;
-+ else if (is_tv)
- /* XXX: just matching BIOS for now */
--/* dpll |= PLL_REF_INPUT_TVCLKINBC; */
-+ /* dpll |= PLL_REF_INPUT_TVCLKINBC; */
- dpll |= 3;
-- }
-+ else if (is_lvds && dev_priv->lvds_use_ssc && num_outputs < 2)
-+ dpll |= PLLB_REF_INPUT_SPREADSPECTRUMIN;
- else
- dpll |= PLL_REF_INPUT_DREFCLK;
-
-@@ -1023,18 +1019,19 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
- }
-
- /* we only need to pin inside GTT if cursor is non-phy */
-+ mutex_lock(&dev->struct_mutex);
- if (!dev_priv->cursor_needs_physical) {
- ret = i915_gem_object_pin(bo, PAGE_SIZE);
- if (ret) {
- DRM_ERROR("failed to pin cursor bo\n");
-- goto fail;
-+ goto fail_locked;
- }
- addr = obj_priv->gtt_offset;
- } else {
- ret = i915_gem_attach_phys_object(dev, bo, (pipe == 0) ? I915_GEM_PHYS_CURSOR_0 : I915_GEM_PHYS_CURSOR_1);
- if (ret) {
- DRM_ERROR("failed to attach phys object\n");
-- goto fail;
-+ goto fail_locked;
- }
- addr = obj_priv->phys_obj->handle->busaddr;
- }
-@@ -1054,10 +1051,9 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
- i915_gem_detach_phys_object(dev, intel_crtc->cursor_bo);
- } else
- i915_gem_object_unpin(intel_crtc->cursor_bo);
-- mutex_lock(&dev->struct_mutex);
- drm_gem_object_unreference(intel_crtc->cursor_bo);
-- mutex_unlock(&dev->struct_mutex);
- }
-+ mutex_unlock(&dev->struct_mutex);
-
- intel_crtc->cursor_addr = addr;
- intel_crtc->cursor_bo = bo;
-@@ -1065,6 +1061,7 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
- return 0;
- fail:
- mutex_lock(&dev->struct_mutex);
-+fail_locked:
- drm_gem_object_unreference(bo);
- mutex_unlock(&dev->struct_mutex);
- return ret;
-@@ -1292,7 +1289,7 @@ static int intel_crtc_clock_get(struct drm_device *dev, struct drm_crtc *crtc)
- }
-
- /* XXX: Handle the 100Mhz refclk */
-- i9xx_clock(96000, &clock);
-+ intel_clock(96000, &clock);
- } else {
- bool is_lvds = (pipe == 1) && (I915_READ(LVDS) & LVDS_PORT_EN);
-
-@@ -1304,9 +1301,9 @@ static int intel_crtc_clock_get(struct drm_device *dev, struct drm_crtc *crtc)
- if ((dpll & PLL_REF_INPUT_MASK) ==
- PLLB_REF_INPUT_SPREADSPECTRUMIN) {
- /* XXX: might not be 66MHz */
-- i8xx_clock(66000, &clock);
-+ intel_clock(66000, &clock);
- } else
-- i8xx_clock(48000, &clock);
-+ intel_clock(48000, &clock);
- } else {
- if (dpll & PLL_P1_DIVIDE_BY_TWO)
- clock.p1 = 2;
-@@ -1319,7 +1316,7 @@ static int intel_crtc_clock_get(struct drm_device *dev, struct drm_crtc *crtc)
- else
- clock.p2 = 2;
-
-- i8xx_clock(48000, &clock);
-+ intel_clock(48000, &clock);
- }
- }
-
-diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
-index afd1217..0fd76d4 100644
---- a/drivers/gpu/drm/i915/intel_fb.c
-+++ b/drivers/gpu/drm/i915/intel_fb.c
-@@ -412,7 +412,8 @@ int intelfb_resize(struct drm_device *dev, struct drm_crtc *crtc)
- }
- EXPORT_SYMBOL(intelfb_resize);
-
--static struct drm_mode_set kernelfb_mode;
-+static struct drm_mode_set *kernelfb_mode[2];
-+static int kernelfb_crtc_count;
-
- static int intelfb_panic(struct notifier_block *n, unsigned long ununsed,
- void *panic_str)
-@@ -688,7 +689,8 @@ static int intelfb_multi_fb_probe_crtc(struct drm_device *dev, struct drm_crtc *
- info->fix.id);
-
- /* Switch back to kernel console on panic */
-- kernelfb_mode = *modeset;
-+ BUG_ON(kernelfb_crtc_count >= ARRAY_SIZE(kernelfb_mode));
-+ kernelfb_mode[kernelfb_crtc_count++] = modeset;
- atomic_notifier_chain_register(&panic_notifier_list, &paniced);
- printk(KERN_INFO "registered panic notifier\n");
-
-@@ -701,6 +703,7 @@ static int intelfb_multi_fb_probe(struct drm_device *dev)
- struct drm_crtc *crtc;
- int ret = 0;
-
-+ kernelfb_crtc_count = 0;
- list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
- ret = intelfb_multi_fb_probe_crtc(dev, crtc);
- if (ret)
-@@ -797,6 +800,7 @@ static int intelfb_single_fb_probe(struct drm_device *dev)
- * For each CRTC, set up the connector list for the CRTC's mode
- * set configuration.
- */
-+ kernelfb_crtc_count = 0;
- list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
- struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
-
-@@ -824,6 +828,9 @@ static int intelfb_single_fb_probe(struct drm_device *dev)
- modeset->num_connectors = conn_count;
- if (modeset->mode != modeset->crtc->desired_mode)
- modeset->mode = modeset->crtc->desired_mode;
-+
-+ BUG_ON(kernelfb_crtc_count >= ARRAY_SIZE(kernelfb_mode));
-+ kernelfb_mode[kernelfb_crtc_count++] = modeset;
- }
- par->crtc_count = crtc_count;
-
-@@ -838,7 +845,6 @@ static int intelfb_single_fb_probe(struct drm_device *dev)
- info->fix.id);
-
- /* Switch back to kernel console on panic */
-- kernelfb_mode = *modeset;
- atomic_notifier_chain_register(&panic_notifier_list, &paniced);
- printk(KERN_INFO "registered panic notifier\n");
-
-@@ -852,7 +858,10 @@ static int intelfb_single_fb_probe(struct drm_device *dev)
- */
- void intelfb_restore(void)
- {
-- drm_crtc_helper_set_config(&kernelfb_mode);
-+ int i;
-+
-+ for (i = 0; i < kernelfb_crtc_count; i++)
-+ drm_crtc_helper_set_config(kernelfb_mode[i]);
- }
-
- static void intelfb_sysrq(int dummy1, struct tty_struct *dummy3)
-@@ -918,7 +927,7 @@ int intelfb_remove(struct drm_device *dev, struct drm_framebuffer *fb)
- }
-
- atomic_notifier_chain_unregister(&panic_notifier_list, &paniced);
-- memset(&kernelfb_mode, 0, sizeof(struct drm_mode_set));
-+ kernelfb_crtc_count = 0;
- return 0;
- }
- EXPORT_SYMBOL(intelfb_remove);
-diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
-index a30508b..fbe6f39 100644
---- a/drivers/gpu/drm/i915/intel_sdvo.c
-+++ b/drivers/gpu/drm/i915/intel_sdvo.c
-@@ -193,7 +193,7 @@ static bool intel_sdvo_write_byte(struct intel_output *intel_output, int addr,
-
- #define SDVO_CMD_NAME_ENTRY(cmd) {cmd, #cmd}
- /** Mapping of command numbers to names, for debug output */
--const static struct _sdvo_cmd_name {
-+static const struct _sdvo_cmd_name {
- u8 cmd;
- char *name;
- } sdvo_cmd_names[] = {
-diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
-index fbb35dc..56485d6 100644
---- a/drivers/gpu/drm/i915/intel_tv.c
-+++ b/drivers/gpu/drm/i915/intel_tv.c
-@@ -411,7 +411,7 @@ struct tv_mode {
- * These values account for -1s required.
- */
-
--const static struct tv_mode tv_modes[] = {
-+static const struct tv_mode tv_modes[] = {
- {
- .name = "NTSC-M",
- .clock = 107520,
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
-index 0c6f0e1..28ff3ee 100644
+index 0b0d236..c7d4b2e 100644
--- a/include/drm/drm_crtc_helper.h
+++ b/include/drm/drm_crtc_helper.h
@@ -76,6 +76,7 @@ struct drm_encoder_helper_funcs {
@@ -854,3 +386,20 @@
/* detect for DAC style encoders */
enum drm_connector_status (*detect)(struct drm_encoder *encoder,
struct drm_connector *connector);
+diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
+index c707c15..ff8d27a 100644
+--- a/include/drm/drm_edid.h
++++ b/include/drm/drm_edid.h
+@@ -58,10 +58,10 @@ struct detailed_pixel_timing {
+ u8 hsync_pulse_width_lo;
+ u8 vsync_pulse_width_lo:4;
+ u8 vsync_offset_lo:4;
+- u8 hsync_pulse_width_hi:2;
+- u8 hsync_offset_hi:2;
+ u8 vsync_pulse_width_hi:2;
+ u8 vsync_offset_hi:2;
++ u8 hsync_pulse_width_hi:2;
++ u8 hsync_offset_hi:2;
+ u8 width_mm_lo;
+ u8 height_mm_lo;
+ u8 height_mm_hi:4;
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1327
retrieving revision 1.1328
diff -u -r1.1327 -r1.1328
--- kernel.spec 24 Feb 2009 06:59:29 -0000 1.1327
+++ kernel.spec 24 Feb 2009 15:11:45 -0000 1.1328
@@ -1151,7 +1151,7 @@
#ApplyPatch drm-next.patch
ApplyPatch drm-modesetting-radeon.patch
ApplyPatch drm-nouveau.patch
-#ApplyPatch drm-intel-next.patch
+ApplyPatch drm-intel-next.patch
ApplyPatch drm-no-gem-on-i8xx.patch
ApplyPatch drm-i915-resume-force-mode.patch
@@ -1750,6 +1750,9 @@
%kernel_variant_files -k vmlinux %{with_kdump} kdump
%changelog
+* Tue Feb 24 2009 Kristian Høgsberg <krh at redhat.com>
+- Pull in new round of intel KMS fixes.
+
* Tue Feb 24 2009 Kyle McMartin <kyle at redhat.com> 2.6.29-0.147.rc6
- Build the kernel (and modules via Kbuild) with -fno-dwarf2-cfi-asm.
Should resolve bz#486545. Thanks to aoliva@ for pointing out this way
More information about the scm-commits
mailing list