[PATCH] drm: Prune GEM vma entries

2010-10-01 Thread Matt Mackall
On Mon, 2010-09-27 at 21:08 +0100, Chris Wilson wrote:
> Hook the GEM vm open/close ops into the generic drm vm open/close so
> that the vma entries are created and destroy appropriately.
> 
> Reported-by: Matt Mackall 
> Cc: Dave Airlie 
> Cc: Jesse Barnes 
> Signed-off-by: Chris Wilson 

All signs point to this being the correct fix, but I won't have time to
test it while I'm in Japan.

Paul, does this work for you?

> ---
>  drivers/gpu/drm/drm_gem.c |9 -
>  drivers/gpu/drm/drm_vm.c  |   28 ++--
>  include/drm/drmP.h|1 +
>  3 files changed, 27 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> index bf92d07..6fe2cd2 100644
> --- a/drivers/gpu/drm/drm_gem.c
> +++ b/drivers/gpu/drm/drm_gem.c
> @@ -528,6 +528,10 @@ void drm_gem_vm_open(struct vm_area_struct *vma)
>   struct drm_gem_object *obj = vma->vm_private_data;
>  
>   drm_gem_object_reference(obj);
> +
> + mutex_lock(>dev->struct_mutex);
> + drm_vm_open_locked(vma);
> + mutex_unlock(>dev->struct_mutex);
>  }
>  EXPORT_SYMBOL(drm_gem_vm_open);
>  
> @@ -535,7 +539,10 @@ void drm_gem_vm_close(struct vm_area_struct *vma)
>  {
>   struct drm_gem_object *obj = vma->vm_private_data;
>  
> - drm_gem_object_unreference_unlocked(obj);
> + mutex_lock(>dev->struct_mutex);
> + drm_vm_close_locked(vma);
> + drm_gem_object_unreference(obj);
> + mutex_unlock(>dev->struct_mutex);
>  }
>  EXPORT_SYMBOL(drm_gem_vm_close);
>  
> diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
> index fda6746..5df4506 100644
> --- a/drivers/gpu/drm/drm_vm.c
> +++ b/drivers/gpu/drm/drm_vm.c
> @@ -433,15 +433,7 @@ static void drm_vm_open(struct vm_area_struct *vma)
>   mutex_unlock(>struct_mutex);
>  }
>  
> -/**
> - * \c close method for all virtual memory types.
> - *
> - * \param vma virtual memory area.
> - *
> - * Search the \p vma private data entry in drm_device::vmalist, unlink it, 
> and
> - * free it.
> - */
> -static void drm_vm_close(struct vm_area_struct *vma)
> +void drm_vm_close_locked(struct vm_area_struct *vma)
>  {
>   struct drm_file *priv = vma->vm_file->private_data;
>   struct drm_device *dev = priv->minor->dev;
> @@ -451,7 +443,6 @@ static void drm_vm_close(struct vm_area_struct *vma)
> vma->vm_start, vma->vm_end - vma->vm_start);
>   atomic_dec(>vma_count);
>  
> - mutex_lock(>struct_mutex);
>   list_for_each_entry_safe(pt, temp, >vmalist, head) {
>   if (pt->vma == vma) {
>   list_del(>head);
> @@ -459,6 +450,23 @@ static void drm_vm_close(struct vm_area_struct *vma)
>   break;
>   }
>   }
> +}
> +
> +/**
> + * \c close method for all virtual memory types.
> + *
> + * \param vma virtual memory area.
> + *
> + * Search the \p vma private data entry in drm_device::vmalist, unlink it, 
> and
> + * free it.
> + */
> +static void drm_vm_close(struct vm_area_struct *vma)
> +{
> + struct drm_file *priv = vma->vm_file->private_data;
> + struct drm_device *dev = priv->minor->dev;
> +
> + mutex_lock(>struct_mutex);
> + drm_vm_close_locked(vma);
>   mutex_unlock(>struct_mutex);
>  }
>  
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index 7809d23..774e1d4 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -1175,6 +1175,7 @@ extern int drm_release(struct inode *inode, struct file 
> *filp);
>  extern int drm_mmap(struct file *filp, struct vm_area_struct *vma);
>  extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma);
>  extern void drm_vm_open_locked(struct vm_area_struct *vma);
> +extern void drm_vm_close_locked(struct vm_area_struct *vma);
>  extern resource_size_t drm_core_get_map_ofs(struct drm_local_map * map);
>  extern resource_size_t drm_core_get_reg_ofs(struct drm_device *dev);
>  extern unsigned int drm_poll(struct file *filp, struct poll_table_struct 
> *wait);


-- 
Mathematics is the supreme nostalgia of our time.




[Bug 30551] r600c: Segfaults with Evergreen

2010-10-01 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=30551

Alex Deucher  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #1 from Alex Deucher  2010-10-01 17:15:51 PDT 
---
fixed in fb0eed84cac3cdb45bd0b46047fc389b81a5b1df

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


[Bug 30551] New: r600c: Segfaults with Evergreen

2010-10-01 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=30551

   Summary: r600c: Segfaults with Evergreen
   Product: Mesa
   Version: git
  Platform: Other
OS/Version: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: Drivers/DRI/R600
AssignedTo: dri-devel at lists.freedesktop.org
ReportedBy: monraaf at gmail.com


Created an attachment (id=39109)
 View: https://bugs.freedesktop.org/attachment.cgi?id=39109
 Review: https://bugs.freedesktop.org/review?bug=30551=39109

fixes segfaults on Evergreen

With latest git master I see a lot of segfaults with Evergreen GPU. Even with
the simple redbook hello program.

Program received signal SIGSEGV, Segmentation fault.
0xb76eb25f in evergreenSendDB (ctx=0x807df78, atom=0x807aca8) at
evergreen_chip.c:956
956 zheight = rrb->base.Height;

It's trying to dereference a null pointer (rrb) here. Proposed fix attached.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


[patch 1/1] drivers/gpu/drm/radeon/atom.c: fix warning

2010-10-01 Thread a...@linux-foundation.org
From: Andrew Morton 

drivers/gpu/drm/radeon/atom.c: In function 'atom_op_delay':
drivers/gpu/drm/radeon/atom.c:653: warning: comparison is always false due to 
limited range of data type

Cc: David Airlie 
Cc: Alex Deucher 
Cc: Matt Turner 
Signed-off-by: Andrew Morton 
---

 drivers/gpu/drm/radeon/atom.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN 
drivers/gpu/drm/radeon/atom.c~drivers-gpu-drm-radeon-atomc-fix-warning 
drivers/gpu/drm/radeon/atom.c
--- a/drivers/gpu/drm/radeon/atom.c~drivers-gpu-drm-radeon-atomc-fix-warning
+++ a/drivers/gpu/drm/radeon/atom.c
@@ -647,7 +647,7 @@ static void atom_op_compare(atom_exec_co

 static void atom_op_delay(atom_exec_context *ctx, int *ptr, int arg)
 {
-   uint8_t count = U8((*ptr)++);
+   unsigned count = U8((*ptr)++);
SDEBUG("   count: %d\n", count);
if (arg == ATOM_UNIT_MICROSEC)
udelay(count);
_


[git pull] drm fixes

2010-10-01 Thread Dave Airlie

> > 
> > We had an unplanned leak/race finding week:
> 
> Updated pull request, TTM extra fix, GEM updated patch with tested by 
> lines, and some urgent vmwgfx oops/fixes. (vmwgfx is in staging still, 
> though I need to discuss that with vmware).

Today is proof the phenylephrine is a poor substitute for pseudoephedrine, 
and both are a poor substitute for sleep.

I've dropped the TTM fixes until next week since Thomas keeps finding 
corner-case issues and I'd like to get to my test box in the office and 
confirm, we know the patch fixes a major leak, just a matter of having 
more confidence in it working in the corners.

Lets get the simpler patches I'm sure about in and I'll send the ttm leak 
fix on its own next week.

Dave.

The following changes since commit 32163f4b2cef28a5aab8b226ffecfc6379a53786:

  alpha: fix usp value in multithreaded coredumps (2010-09-25 14:38:13 -0700)

are available in the git repository at:
  ssh://master.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git drm-fixes

Alex Deucher (3):
  drm/radeon/kms: fix up encoder info messages for DFP6
  drm/radeon/kms: fix potential segfault in r600_ioctl_wait_idle
  drm/radeon/kms: add quirk for MSI K9A2GM motherboard

Arnd Bergmann (1):
  drm: i810/i830: fix locked ioctl variant

Chris Wilson (2):
  drm: Prune GEM vma entries
  drm: Hold the mutex when dropping the last GEM reference (v2)

Dave Airlie (2):
  drm/radeon: fix PCI ID 5657 to be an RV410
  drm/gem: handlecount isn't really a kref so don't make it one.

Thomas Hellstrom (5):
  drm/vmwgfx: Fix breakage introduced by commit "drm: block userspace under 
allocating buffer and having drivers overwrite it (v2)"
  vmwgfx: vt-switch (master drop) fixes
  vmwgfx: Enable use of the vblank system
  vmwgfx: Remove initialisation of dev::devname
  vmwgfx: Fix fb VRAM pinning failure due to fragmentation

 drivers/gpu/drm/drm_gem.c  |   39 ++--
 drivers/gpu/drm/drm_info.c |2 +-
 drivers/gpu/drm/drm_vm.c   |   28 --
 drivers/gpu/drm/i810/i810_dma.c|2 +-
 drivers/gpu/drm/i830/i830_dma.c|2 +-
 drivers/gpu/drm/i915/i915_gem.c|6 +-
 drivers/gpu/drm/i915/intel_fb.c|4 +-
 drivers/gpu/drm/nouveau/nouveau_fbcon.c|1 +
 drivers/gpu/drm/nouveau/nouveau_gem.c  |6 +-
 drivers/gpu/drm/nouveau/nouveau_notifier.c |1 +
 drivers/gpu/drm/radeon/r600.c  |3 +-
 drivers/gpu/drm/radeon/radeon_atombios.c   |9 ++
 drivers/gpu/drm/radeon/radeon_display.c|5 +-
 drivers/gpu/drm/radeon/radeon_fb.c |   14 +--
 drivers/gpu/drm/radeon/radeon_gem.c|4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c|  145 +---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h|8 ++
 drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |5 +
 drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c   |3 +
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c|   17 
 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c|   27 --
 drivers/gpu/drm/vmwgfx/vmwgfx_resource.c   |4 +
 include/drm/drmP.h |   29 --
 include/drm/drm_pciids.h   |2 +-
 24 files changed, 246 insertions(+), 120 deletions(-)


[PATCH] drm/ttm: Fix busy codepaths of the "Fix two race conditions" commit.

2010-10-01 Thread Thomas Hellstrom
The above mentioned commit didn't queue the buffer on the delayed destroy
list under some rare circumstances. It also didn't completely honor the
remove_all parameter.

Signed-off-by: Thomas Hellstrom 
---
 drivers/gpu/drm/ttm/ttm_bo.c |   15 +++
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index b98cb2c..db809e0 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -493,6 +493,7 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object 
*bo, bool remove_all)
int ret;

spin_lock(>lock);
+retry:
(void) ttm_bo_wait(bo, false, false, !remove_all);

if (!bo->sync_obj) {
@@ -501,15 +502,16 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object 
*bo, bool remove_all)
spin_unlock(>lock);

spin_lock(>lru_lock);
-   ret = ttm_bo_reserve_locked(bo, false, true, false, 0);
+   ret = ttm_bo_reserve_locked(bo, false, !remove_all, false, 0);

/**
 * Someone else has the object reserved. Bail and retry.
 */

-   if (unlikely(ret != 0)) {
+   if (unlikely(ret == -EBUSY)) {
spin_unlock(>lru_lock);
-   return 0;
+   spin_lock(>lock);
+   goto requeue;
}

/**
@@ -524,6 +526,11 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object 
*bo, bool remove_all)
atomic_set(>reserved, 0);
wake_up_all(>event_queue);
spin_unlock(>lru_lock);
+   spin_lock(>lock);
+   if (remove_all)
+   goto retry;
+   else
+   goto requeue;
}

put_count = ttm_bo_del_from_lru(bo);
@@ -540,7 +547,7 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object 
*bo, bool remove_all)

return 0;
}
-
+requeue:
spin_lock(>lru_lock);
if (list_empty(>ddestroy)) {
void *sync_obj = bo->sync_obj;
-- 
1.6.2.5



[PATCH] DRM: ignore invalid EDID extensions

2010-10-01 Thread Sam Tygier
On 22/09/10 22:55, Adam Jackson wrote:
> Yeah, I hate to just drop extension blocks, but it's better than the
> alternative.  They're optional for a reason I suppose.
>
 For my EIZO S2242W the base block is fine, but the extension block is
 all zeros. Without this patch I get no X and no VTs.
>>>
>>> I suspect what's actually happening there is that we're failing to get
>>> the extension block, not that it's being returned as zeros.
>>
>> Could this be fixed? Anything I could try?
>
> Depends on what your driver is, I suspect.  Did it ever work?
>
> - ajax

I have git bisected, which takes me to

61e57a8d72f2336faf39b5d940215cf085e01e6e is the first bad commit
commit 61e57a8d72f2336faf39b5d940215cf085e01e6e
Author: Adam Jackson 
Date:   Mon Mar 29 21:43:18 2010 +

 drm/edid: Fix secondary block fetch.

 This makes fetching the second EDID block on HDMI monitors actually
 work.  DDC can't transfer more than 128 bytes at a time.  Also,
 rearrange the code so the pure DDC bits are separate from block parse.

 Signed-off-by: Adam Jackson 
 Signed-off-by: Dave Airlie 

:04 04 a0b022ba678bd92c46e2ecba63d5f2c78f69b0c3 
77e672eec31b83465f6fe8ee3ca6c0153a0af230 M  drivers
:04 04 99e72b1f7f6b4016606ed3388b902a5f39b9c13b 
3b1e49f0fb674e4974a77021bc90dfce7098ecc6 M  include

full log

git bisect start
# good: [e40152ee1e1c7a63f491863215e3faa37a86] Linus 2.6.34
git bisect good e40152ee1e1c7a63f491863215e3faa37a86
# bad: [815c4163b6c8ebf8152f42b0a5fd015cfdcedc78] Linux 2.6.35-rc4
git bisect bad 815c4163b6c8ebf8152f42b0a5fd015cfdcedc78
# good: [c316ba3b518bc35ce5aef5421135220389f4eb98] Merge branch 'linux-next' of 
git://git.infradead.org/ubi-2.6
git bisect good c316ba3b518bc35ce5aef5421135220389f4eb98
# bad: [6d94d4081048756df78444a07201156f4930fe48] lis3: interrupt handlers for 
8bit wakeup and click events
git bisect bad 6d94d4081048756df78444a07201156f4930fe48
# bad: [6e80e8ed5eb92d0112674aabe82951266a6a1051] Merge branch 'for-2.6.35' of 
git://git.kernel.dk/linux-2.6-block
git bisect bad 6e80e8ed5eb92d0112674aabe82951266a6a1051
# good: [ac3ee84c604502240122c47b52f0542ec8774f15] Merge branch 
'dbg-early-merge' of 
git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb
git bisect good ac3ee84c604502240122c47b52f0542ec8774f15
# bad: [59534f7298c5e28aaa64e6ed550e247f64ee72ae] Merge branch 'drm-for-2.6.35' 
of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
git bisect bad 59534f7298c5e28aaa64e6ed550e247f64ee72ae
# bad: [7547a917fa5f3b2406f52c7dcf7ec9ad3c8532eb] Merge branch 
'drm-ttm-unmappable' into drm-core-next
git bisect bad 7547a917fa5f3b2406f52c7dcf7ec9ad3c8532eb
# good: [c2b41276da65481d36311a13d69020d150861c43] Merge branch 'drm-ttm-pool' 
into drm-core-next
git bisect good c2b41276da65481d36311a13d69020d150861c43
# bad: [7fff400be6fbf64f10abca9939718aaf1d61c255] Merge branch 
'drm-fbdev-cleanup' into drm-core-next
git bisect bad 7fff400be6fbf64f10abca9939718aaf1d61c255
# bad: [171fdd892979081e8a9b1a67ce86c7008b7abbdf] drm/modes: Fix interlaced 
mode names
git bisect bad 171fdd892979081e8a9b1a67ce86c7008b7abbdf
# bad: [59d8aff6e4fc2705053e7ce2948b51f7fe507536] drm/edid: Remove some silly 
comments
git bisect bad 59d8aff6e4fc2705053e7ce2948b51f7fe507536
# bad: [2b470ab075b30aaeeab29d67b8f1f111096a5fbe] drm/edid: Remove a redundant 
check
git bisect bad 2b470ab075b30aaeeab29d67b8f1f111096a5fbe
# bad: [fbcc06b6439024b967cf6927b95d303f4c3c1a4f] drm/edid: Remove some 
misleading comments
git bisect bad fbcc06b6439024b967cf6927b95d303f4c3c1a4f
# bad: [61e57a8d72f2336faf39b5d940215cf085e01e6e] drm/edid: Fix secondary block 
fetch.
git bisect bad 61e57a8d72f2336faf39b5d940215cf085e01e6e

before 61e57a8d72f2336faf39b5d940215cf085e01e6e, the monitor is detected and 
gives the correct resolution and everything boots normally with kms.

after i get the
radeon :08:00.0: DVI-I-1: EDID block 1 invalid.
and no X or VTs, unless i disable KMS (in which case it boots fine)

Is there anything else you want me to test? would it be helpful for me to start 
a bug on fdo?

Thanks

Sam



[PATCH] drm/ttm: Fix missing return

2010-10-01 Thread Thomas Hellstrom
Hmm. Forget this patch! I must have been extremely tired today. A new 
one coming up in a moment.

/Thomas


On 10/01/2010 10:09 AM, Thomas Hellstrom wrote:
> The commit "drm/ttm: Fix two race conditions"
> was missing a return statement in a very unlikely code path.
>
> Signed-off-by: Thomas Hellstrom
> ---
>   drivers/gpu/drm/ttm/ttm_bo.c |1 +
>   1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index b98cb2c..d6000d7 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -524,6 +524,7 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object 
> *bo, bool remove_all)
>   atomic_set(>reserved, 0);
>   wake_up_all(>event_queue);
>   spin_unlock(>lru_lock);
> + return 0;
>   }
>
>   put_count = ttm_bo_del_from_lru(bo);
>



[PATCH 4/4] vmwgfx: Fix fb VRAM pinning failure due to fragmentation

2010-10-01 Thread Thomas Hellstrom
If the soon-to-be scanout buffer is partly covering the intended
VRAM region, move and pin will fail. In that case, just move it out
to system before attempting to move it in again.

Signed-off-by: Thomas Hellstrom 
---
 drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c 
b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
index 870967a..409e172 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
@@ -615,6 +615,11 @@ int vmw_dmabuf_to_start_of_vram(struct vmw_private 
*vmw_priv,
if (unlikely(ret != 0))
goto err_unlock;

+   if (bo->mem.mem_type == TTM_PL_VRAM &&
+   bo->mem.mm_node->start < bo->num_pages)
+   (void) ttm_bo_validate(bo, _sys_placement, false,
+  false, false);
+
ret = ttm_bo_validate(bo, _placement, false, false, false);

/* Could probably bug on */
-- 
1.6.2.5



[PATCH 3/4] vmwgfx: Remove initialisation of dev::devname

2010-10-01 Thread Thomas Hellstrom
The removed code causes oopses with newer drms on master drop.

Signed-off-by: Thomas Hellstrom 
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c |6 --
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c 
b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 6bbe703..a96ed6d 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -148,7 +148,6 @@ static struct pci_device_id vmw_pci_id_list[] = {
{0, 0, 0}
 };

-static char *vmw_devname = "vmwgfx";
 static int enable_fbdev;

 static int vmw_probe(struct pci_dev *, const struct pci_device_id *);
@@ -407,9 +406,6 @@ static int vmw_driver_load(struct drm_device *dev, unsigned 
long chipset)
 "running the device in SVGA mode yet.\n");
}

-   if (!dev->devname)
-   dev->devname = vmw_devname;
-
if (dev_priv->capabilities & SVGA_CAP_IRQMASK) {
ret = drm_irq_install(dev);
if (unlikely(ret != 0)) {
@@ -466,8 +462,6 @@ static int vmw_driver_unload(struct drm_device *dev)

if (dev_priv->capabilities & SVGA_CAP_IRQMASK)
drm_irq_uninstall(dev_priv->dev);
-   if (dev->devname == vmw_devname)
-   dev->devname = NULL;
if (dev_priv->enable_fb) {
vmw_fb_close(dev_priv);
vmw_kms_restore_vga(dev_priv);
-- 
1.6.2.5



[PATCH 2/4] vmwgfx: Enable use of the vblank system

2010-10-01 Thread Thomas Hellstrom
This is to avoid accessing uninitialized data during
drm_irq_uninstall and vblank ioctls. At the same time, enable error check from
drm_kms_init which previously appeared to ignore all errors.

Signed-off-by: Thomas Hellstrom 
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c |   47 +++---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h |1 +
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c |5 +++
 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c |   27 ---
 4 files changed, 49 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c 
b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 23e29f3..6bbe703 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -374,17 +374,6 @@ static int vmw_driver_load(struct drm_device *dev, 
unsigned long chipset)

dev->dev_private = dev_priv;

-   if (!dev->devname)
-   dev->devname = vmw_devname;
-
-   if (dev_priv->capabilities & SVGA_CAP_IRQMASK) {
-   ret = drm_irq_install(dev);
-   if (unlikely(ret != 0)) {
-   DRM_ERROR("Failed installing irq: %d\n", ret);
-   goto out_no_irq;
-   }
-   }
-
ret = pci_request_regions(dev->pdev, "vmwgfx probe");
dev_priv->stealth = (ret != 0);
if (dev_priv->stealth) {
@@ -400,7 +389,9 @@ static int vmw_driver_load(struct drm_device *dev, unsigned 
long chipset)
goto out_no_device;
}
}
-   vmw_kms_init(dev_priv);
+   ret = vmw_kms_init(dev_priv);
+   if (unlikely(ret != 0))
+   goto out_no_kms;
vmw_overlay_init(dev_priv);
if (dev_priv->enable_fb) {
ret = vmw_3d_resource_inc(dev_priv);
@@ -416,24 +407,37 @@ static int vmw_driver_load(struct drm_device *dev, 
unsigned long chipset)
 "running the device in SVGA mode yet.\n");
}

+   if (!dev->devname)
+   dev->devname = vmw_devname;
+
+   if (dev_priv->capabilities & SVGA_CAP_IRQMASK) {
+   ret = drm_irq_install(dev);
+   if (unlikely(ret != 0)) {
+   DRM_ERROR("Failed installing irq: %d\n", ret);
+   goto out_no_irq;
+   }
+   }
+
dev_priv->pm_nb.notifier_call = vmwgfx_pm_notifier;
register_pm_notifier(_priv->pm_nb);

return 0;

+out_no_irq:
+   if (dev_priv->enable_fb) {
+   vmw_fb_close(dev_priv);
+   vmw_kms_restore_vga(dev_priv);
+   vmw_3d_resource_dec(dev_priv);
+   }
 out_no_fifo:
vmw_overlay_close(dev_priv);
vmw_kms_close(dev_priv);
+out_no_kms:
if (dev_priv->stealth)
pci_release_region(dev->pdev, 2);
else
pci_release_regions(dev->pdev);
 out_no_device:
-   if (dev_priv->capabilities & SVGA_CAP_IRQMASK)
-   drm_irq_uninstall(dev_priv->dev);
-   if (dev->devname == vmw_devname)
-   dev->devname = NULL;
-out_no_irq:
ttm_object_device_release(_priv->tdev);
 out_err4:
iounmap(dev_priv->mmio_virt);
@@ -460,6 +464,10 @@ static int vmw_driver_unload(struct drm_device *dev)

unregister_pm_notifier(_priv->pm_nb);

+   if (dev_priv->capabilities & SVGA_CAP_IRQMASK)
+   drm_irq_uninstall(dev_priv->dev);
+   if (dev->devname == vmw_devname)
+   dev->devname = NULL;
if (dev_priv->enable_fb) {
vmw_fb_close(dev_priv);
vmw_kms_restore_vga(dev_priv);
@@ -472,10 +480,6 @@ static int vmw_driver_unload(struct drm_device *dev)
else
pci_release_regions(dev->pdev);

-   if (dev_priv->capabilities & SVGA_CAP_IRQMASK)
-   drm_irq_uninstall(dev_priv->dev);
-   if (dev->devname == vmw_devname)
-   dev->devname = NULL;
ttm_object_device_release(_priv->tdev);
iounmap(dev_priv->mmio_virt);
drm_mtrr_del(dev_priv->mmio_mtrr, dev_priv->mmio_start,
@@ -798,6 +802,7 @@ static struct drm_driver driver = {
.irq_postinstall = vmw_irq_postinstall,
.irq_uninstall = vmw_irq_uninstall,
.irq_handler = vmw_irq_handler,
+   .get_vblank_counter = vmw_get_vblank_counter,
.reclaim_buffers_locked = NULL,
.get_map_ofs = drm_core_get_map_ofs,
.get_reg_ofs = drm_core_get_reg_ofs,
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h 
b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
index 9142454..58de639 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
@@ -518,6 +518,7 @@ void vmw_kms_write_svga(struct vmw_private *vmw_priv,
unsigned bbp, unsigned depth);
 int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv);
+u32 vmw_get_vblank_counter(struct drm_device *dev, int crtc);

 /**
  * Overlay control - 

[PATCH 1/4] vmwgfx: vt-switch (master drop) fixes

2010-10-01 Thread Thomas Hellstrom
We add an option not to enable fbdev, this option is off (0) by default.
Not enabling fbdev at load time makes it possible to co-operate with
vga16fb and vga text mode when VT switching.

However, if 3D resources are active when VT switching, we're currently
not able to switch over to vga, due to device limitations.
This fixes a bug where we previously lost 3D state during VT switch.

Signed-off-by: Thomas Hellstrom 
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c  |  102 ++
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h  |7 ++
 drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c |3 +
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c  |   12 
 drivers/gpu/drm/vmwgfx/vmwgfx_resource.c |4 +
 5 files changed, 115 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c 
b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 292aeba..23e29f3 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -149,12 +149,16 @@ static struct pci_device_id vmw_pci_id_list[] = {
 };

 static char *vmw_devname = "vmwgfx";
+static int enable_fbdev;

 static int vmw_probe(struct pci_dev *, const struct pci_device_id *);
 static void vmw_master_init(struct vmw_master *);
 static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val,
  void *ptr);

+MODULE_PARM_DESC(enable_fbdev, "Enable vmwgfx fbdev");
+module_param_named(enable_fbdev, enable_fbdev, int, 0600);
+
 static void vmw_print_capabilities(uint32_t capabilities)
 {
DRM_INFO("Capabilities:\n");
@@ -192,8 +196,6 @@ static int vmw_request_device(struct vmw_private *dev_priv)
 {
int ret;

-   vmw_kms_save_vga(dev_priv);
-
ret = vmw_fifo_init(dev_priv, _priv->fifo);
if (unlikely(ret != 0)) {
DRM_ERROR("Unable to initialize FIFO.\n");
@@ -206,10 +208,36 @@ static int vmw_request_device(struct vmw_private 
*dev_priv)
 static void vmw_release_device(struct vmw_private *dev_priv)
 {
vmw_fifo_release(dev_priv, _priv->fifo);
-   vmw_kms_restore_vga(dev_priv);
+}
+
+int vmw_3d_resource_inc(struct vmw_private *dev_priv)
+{
+   int ret = 0;
+
+   mutex_lock(_priv->release_mutex);
+   if (unlikely(dev_priv->num_3d_resources++ == 0)) {
+   ret = vmw_request_device(dev_priv);
+   if (unlikely(ret != 0))
+   --dev_priv->num_3d_resources;
+   }
+   mutex_unlock(_priv->release_mutex);
+   return ret;
 }


+void vmw_3d_resource_dec(struct vmw_private *dev_priv)
+{
+   int32_t n3d;
+
+   mutex_lock(_priv->release_mutex);
+   if (unlikely(--dev_priv->num_3d_resources == 0))
+   vmw_release_device(dev_priv);
+   n3d = (int32_t) dev_priv->num_3d_resources;
+   mutex_unlock(_priv->release_mutex);
+
+   BUG_ON(n3d < 0);
+}
+
 static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
 {
struct vmw_private *dev_priv;
@@ -228,6 +256,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned 
long chipset)
dev_priv->last_read_sequence = (uint32_t) -100;
mutex_init(_priv->hw_mutex);
mutex_init(_priv->cmdbuf_mutex);
+   mutex_init(_priv->release_mutex);
rwlock_init(_priv->resource_lock);
idr_init(_priv->context_idr);
idr_init(_priv->surface_idr);
@@ -244,6 +273,8 @@ static int vmw_driver_load(struct drm_device *dev, unsigned 
long chipset)
dev_priv->vram_start = pci_resource_start(dev->pdev, 1);
dev_priv->mmio_start = pci_resource_start(dev->pdev, 2);

+   dev_priv->enable_fb = enable_fbdev;
+
mutex_lock(_priv->hw_mutex);

vmw_write(dev_priv, SVGA_REG_ID, SVGA_ID_2);
@@ -369,20 +400,34 @@ static int vmw_driver_load(struct drm_device *dev, 
unsigned long chipset)
goto out_no_device;
}
}
-   ret = vmw_request_device(dev_priv);
-   if (unlikely(ret != 0))
-   goto out_no_device;
vmw_kms_init(dev_priv);
vmw_overlay_init(dev_priv);
-   vmw_fb_init(dev_priv);
+   if (dev_priv->enable_fb) {
+   ret = vmw_3d_resource_inc(dev_priv);
+   if (unlikely(ret != 0))
+   goto out_no_fifo;
+   vmw_kms_save_vga(dev_priv);
+   vmw_fb_init(dev_priv);
+   DRM_INFO("%s", vmw_fifo_have_3d(dev_priv) ?
+"Detected device 3D availability.\n" :
+"Detected no device 3D availability.\n");
+   } else {
+   DRM_INFO("Delayed 3D detection since we're not "
+"running the device in SVGA mode yet.\n");
+   }

dev_priv->pm_nb.notifier_call = vmwgfx_pm_notifier;
register_pm_notifier(_priv->pm_nb);

-   DRM_INFO("%s", vmw_fifo_have_3d(dev_priv) ? "Have 3D\n" : "No 3D\n");
-
return 0;

+out_no_fifo:
+   vmw_overlay_close(dev_priv);
+   vmw_kms_close(dev_priv);

[PATCH 0/4] Urgent vmwgfx fixes.

2010-10-01 Thread Thomas Hellstrom
These are fixes that should, if at all possible, make it into 2.6.36.

They are extracted from the previous patch series, "vmwgfx updates".
I will respin the rest of the patches for possible inclusion into drm-next.
I've renamed some patches and added some comment to emphasise the
fixes in them rather than what's actually being done with the code.

Patch 1 fixes vt switching while 3D objects are active. Previously the device 
lost all state at that point.
Patch 2 enables the vblank system and avoids a lot of uninitialized calls 
(kernel crashes)
Patch 3 removes a workaround for dev::devname the current code caused a kernel 
crash at module unload then dev::devname was beeing kfreed when it was actually 
static.
Patch 4 Fixes a bo pinning error causing severe rendering corruption.

Thanks,
Thomas


[PATCH] drm/ttm: Fix two race conditions

2010-10-01 Thread Julien Cristau
On Thu, Sep 30, 2010 at 12:36:45 +0200, Thomas Hellstrom wrote:

> This fixes a race pointed out by Dave Airlie where we don't take a buffer
> object about to be destroyed off the LRU lists properly. It also fixes a rare
> case where a buffer object could be destroyed in the middle of an
> accelerated eviction.
> 
> The patch also adds a utility function that can be used to prematurely
> release GPU memory space usage of an object waiting to be destroyed.
> For example during eviction or swapout.
> 
> Signed-off-by: Thomas Hellstrom 

FWIW, from the debian bug:
Tested-by: "Eduardo I." 

Cheers,
Julien


[PATCH] drm/ttm: Fix missing return

2010-10-01 Thread Thomas Hellstrom
The commit "drm/ttm: Fix two race conditions"
was missing a return statement in a very unlikely code path.

Signed-off-by: Thomas Hellstrom 
---
 drivers/gpu/drm/ttm/ttm_bo.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index b98cb2c..d6000d7 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -524,6 +524,7 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object 
*bo, bool remove_all)
atomic_set(>reserved, 0);
wake_up_all(>event_queue);
spin_unlock(>lru_lock);
+   return 0;
}

put_count = ttm_bo_del_from_lru(bo);
-- 
1.6.2.5



[git pull] drm fixes

2010-10-01 Thread Dave Airlie

> Hi Linus,
> 
> We had an unplanned leak/race finding week:

Updated pull request, TTM extra fix, GEM updated patch with tested by 
lines, and some urgent vmwgfx oops/fixes. (vmwgfx is in staging still, 
though I need to discuss that with vmware).

Dave.


> Had a pretty nasty race in TTM reported (scrolling certain pages in 
> firefox caused a major leak of objects), fix from Thomas in here.
> 
> A nasty slow leak in the i915 GEM code, fix from Chris here.
> A race on object deletion in the GEM code, fix from Chris.
> 
> A leak/memory corruptor when unloading drm modules after X had started due 
> to using krefs in a non-kref compatible manner, fix from me (found while 
> tracking down the firefox one).
> 
> Apart from that, just some general radeon fixes, a BKL regression fix, a 
> vmware regression fix from the ioctl cleanups.
> 
The following changes since commit 32163f4b2cef28a5aab8b226ffecfc6379a53786:

  alpha: fix usp value in multithreaded coredumps (2010-09-25 14:38:13 -0700)

are available in the git repository at:
  ssh://master.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git drm-fixes

Alex Deucher (3):
  drm/radeon/kms: fix up encoder info messages for DFP6
  drm/radeon/kms: fix potential segfault in r600_ioctl_wait_idle
  drm/radeon/kms: add quirk for MSI K9A2GM motherboard

Arnd Bergmann (1):
  drm: i810/i830: fix locked ioctl variant

Chris Wilson (2):
  drm: Prune GEM vma entries
  drm: Hold the mutex when dropping the last GEM reference (v2)

Dave Airlie (2):
  drm/radeon: fix PCI ID 5657 to be an RV410
  drm/gem: handlecount isn't really a kref so don't make it one.

Thomas Hellstrom (7):
  drm/ttm: Fix two race conditions
  drm/vmwgfx: Fix breakage introduced by commit "drm: block userspace under 
allocating buffer and having drivers overwrite it (v2)"
  drm/ttm: Fix missing return
  vmwgfx: vt-switch (master drop) fixes
  vmwgfx: Enable use of the vblank system
  vmwgfx: Remove initialisation of dev::devname
  vmwgfx: Fix fb VRAM pinning failure due to fragmentation

 drivers/gpu/drm/drm_gem.c  |   39 ++--
 drivers/gpu/drm/drm_info.c |2 +-
 drivers/gpu/drm/drm_vm.c   |   28 --
 drivers/gpu/drm/i810/i810_dma.c|2 +-
 drivers/gpu/drm/i830/i830_dma.c|2 +-
 drivers/gpu/drm/i915/i915_gem.c|6 +-
 drivers/gpu/drm/i915/intel_fb.c|4 +-
 drivers/gpu/drm/nouveau/nouveau_fbcon.c|1 +
 drivers/gpu/drm/nouveau/nouveau_gem.c  |6 +-
 drivers/gpu/drm/nouveau/nouveau_notifier.c |1 +
 drivers/gpu/drm/radeon/r600.c  |3 +-
 drivers/gpu/drm/radeon/radeon_atombios.c   |9 ++
 drivers/gpu/drm/radeon/radeon_display.c|5 +-
 drivers/gpu/drm/radeon/radeon_fb.c |   14 +--
 drivers/gpu/drm/radeon/radeon_gem.c|4 +-
 drivers/gpu/drm/ttm/ttm_bo.c   |   75 --
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c|  145 +---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h|8 ++
 drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |5 +
 drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c   |3 +
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c|   17 
 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c|   27 --
 drivers/gpu/drm/vmwgfx/vmwgfx_resource.c   |4 +
 include/drm/drmP.h |   29 --
 include/drm/drm_pciids.h   |2 +-
 include/drm/ttm/ttm_bo_api.h   |4 +-
 26 files changed, 313 insertions(+), 132 deletions(-)


[git pull] drm fixes

2010-10-01 Thread Dave Airlie

Hi Linus,

We had an unplanned leak/race finding week:

Had a pretty nasty race in TTM reported (scrolling certain pages in 
firefox caused a major leak of objects), fix from Thomas in here.

A nasty slow leak in the i915 GEM code, fix from Chris here.
A race on object deletion in the GEM code, fix from Chris.

A leak/memory corruptor when unloading drm modules after X had started due 
to using krefs in a non-kref compatible manner, fix from me (found while 
tracking down the firefox one).

Apart from that, just some general radeon fixes, a BKL regression fix, a 
vmware regression fix from the ioctl cleanups.

Dave.

The following changes since commit 32163f4b2cef28a5aab8b226ffecfc6379a53786:

  alpha: fix usp value in multithreaded coredumps (2010-09-25 14:38:13 -0700)

are available in the git repository at:
  ssh://master.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git drm-fixes

Alex Deucher (3):
  drm/radeon/kms: fix up encoder info messages for DFP6
  drm/radeon/kms: fix potential segfault in r600_ioctl_wait_idle
  drm/radeon/kms: add quirk for MSI K9A2GM motherboard

Arnd Bergmann (1):
  drm: i810/i830: fix locked ioctl variant

Chris Wilson (2):
  drm: Prune GEM vma entries
  drm: Hold the mutex when dropping the last GEM reference

Dave Airlie (2):
  drm/radeon: fix PCI ID 5657 to be an RV410
  drm/gem: handlecount isn't really a kref so don't make it one.

Thomas Hellstrom (2):
  drm/ttm: Fix two race conditions
  drm/vmwgfx: Fix breakage introduced by commit "drm: block userspace under 
allocating buffer and having drivers overwrite it (v2)"

 drivers/gpu/drm/drm_gem.c  |   39 ---
 drivers/gpu/drm/drm_info.c |2 +-
 drivers/gpu/drm/drm_vm.c   |   28 +++
 drivers/gpu/drm/i810/i810_dma.c|2 +-
 drivers/gpu/drm/i830/i830_dma.c|2 +-
 drivers/gpu/drm/i915/i915_gem.c|6 +--
 drivers/gpu/drm/i915/intel_fb.c|4 +-
 drivers/gpu/drm/nouveau/nouveau_fbcon.c|1 +
 drivers/gpu/drm/nouveau/nouveau_gem.c  |6 +--
 drivers/gpu/drm/nouveau/nouveau_notifier.c |1 +
 drivers/gpu/drm/radeon/r600.c  |3 +-
 drivers/gpu/drm/radeon/radeon_atombios.c   |9 +++
 drivers/gpu/drm/radeon/radeon_display.c|5 ++-
 drivers/gpu/drm/radeon/radeon_fb.c |   14 ++
 drivers/gpu/drm/radeon/radeon_gem.c|4 +-
 drivers/gpu/drm/ttm/ttm_bo.c   |   74 +++
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c|2 +-
 include/drm/drmP.h |   28 ---
 include/drm/drm_pciids.h   |2 +-
 include/drm/ttm/ttm_bo_api.h   |4 +-
 20 files changed, 149 insertions(+), 87 deletions(-)


[Bug 30265] r600g: potential memory leak

2010-10-01 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=30265

Nicolas Kaiser  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #2 from Nicolas Kaiser  2010-10-01 04:34:19 PDT 
---
Since mesa commit 7ee8fa0421fd3c6522120d8639c6b311674a9b10
(Jerome Glisse, "r600g: switch to new design"), there is no more
definitely lost memory detected with valgrind.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


[PATCH] drm/ttm: Fix missing return

2010-10-01 Thread Thomas Hellstrom
The commit drm/ttm: Fix two race conditions
was missing a return statement in a very unlikely code path.

Signed-off-by: Thomas Hellstrom thellst...@vmware.com
---
 drivers/gpu/drm/ttm/ttm_bo.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index b98cb2c..d6000d7 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -524,6 +524,7 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object 
*bo, bool remove_all)
atomic_set(bo-reserved, 0);
wake_up_all(bo-event_queue);
spin_unlock(glob-lru_lock);
+   return 0;
}
 
put_count = ttm_bo_del_from_lru(bo);
-- 
1.6.2.5

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/ttm: Fix two race conditions

2010-10-01 Thread Julien Cristau
On Thu, Sep 30, 2010 at 12:36:45 +0200, Thomas Hellstrom wrote:

 This fixes a race pointed out by Dave Airlie where we don't take a buffer
 object about to be destroyed off the LRU lists properly. It also fixes a rare
 case where a buffer object could be destroyed in the middle of an
 accelerated eviction.
 
 The patch also adds a utility function that can be used to prematurely
 release GPU memory space usage of an object waiting to be destroyed.
 For example during eviction or swapout.
 
 Signed-off-by: Thomas Hellstrom thellst...@vmware.com

FWIW, from the debian bug:
Tested-by: Eduardo I. persegui...@gmail.com

Cheers,
Julien
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 0/4] Urgent vmwgfx fixes.

2010-10-01 Thread Thomas Hellstrom
These are fixes that should, if at all possible, make it into 2.6.36.

They are extracted from the previous patch series, vmwgfx updates.
I will respin the rest of the patches for possible inclusion into drm-next.
I've renamed some patches and added some comment to emphasise the
fixes in them rather than what's actually being done with the code.

Patch 1 fixes vt switching while 3D objects are active. Previously the device 
lost all state at that point.
Patch 2 enables the vblank system and avoids a lot of uninitialized calls 
(kernel crashes)
Patch 3 removes a workaround for dev::devname the current code caused a kernel 
crash at module unload then dev::devname was beeing kfreed when it was actually 
static.
Patch 4 Fixes a bo pinning error causing severe rendering corruption.

Thanks,
Thomas
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 2/4] vmwgfx: Enable use of the vblank system

2010-10-01 Thread Thomas Hellstrom
This is to avoid accessing uninitialized data during
drm_irq_uninstall and vblank ioctls. At the same time, enable error check from
drm_kms_init which previously appeared to ignore all errors.

Signed-off-by: Thomas Hellstrom thellst...@vmware.com
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c |   47 +++---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h |1 +
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c |5 +++
 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c |   27 ---
 4 files changed, 49 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c 
b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 23e29f3..6bbe703 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -374,17 +374,6 @@ static int vmw_driver_load(struct drm_device *dev, 
unsigned long chipset)
 
dev-dev_private = dev_priv;
 
-   if (!dev-devname)
-   dev-devname = vmw_devname;
-
-   if (dev_priv-capabilities  SVGA_CAP_IRQMASK) {
-   ret = drm_irq_install(dev);
-   if (unlikely(ret != 0)) {
-   DRM_ERROR(Failed installing irq: %d\n, ret);
-   goto out_no_irq;
-   }
-   }
-
ret = pci_request_regions(dev-pdev, vmwgfx probe);
dev_priv-stealth = (ret != 0);
if (dev_priv-stealth) {
@@ -400,7 +389,9 @@ static int vmw_driver_load(struct drm_device *dev, unsigned 
long chipset)
goto out_no_device;
}
}
-   vmw_kms_init(dev_priv);
+   ret = vmw_kms_init(dev_priv);
+   if (unlikely(ret != 0))
+   goto out_no_kms;
vmw_overlay_init(dev_priv);
if (dev_priv-enable_fb) {
ret = vmw_3d_resource_inc(dev_priv);
@@ -416,24 +407,37 @@ static int vmw_driver_load(struct drm_device *dev, 
unsigned long chipset)
 running the device in SVGA mode yet.\n);
}
 
+   if (!dev-devname)
+   dev-devname = vmw_devname;
+
+   if (dev_priv-capabilities  SVGA_CAP_IRQMASK) {
+   ret = drm_irq_install(dev);
+   if (unlikely(ret != 0)) {
+   DRM_ERROR(Failed installing irq: %d\n, ret);
+   goto out_no_irq;
+   }
+   }
+
dev_priv-pm_nb.notifier_call = vmwgfx_pm_notifier;
register_pm_notifier(dev_priv-pm_nb);
 
return 0;
 
+out_no_irq:
+   if (dev_priv-enable_fb) {
+   vmw_fb_close(dev_priv);
+   vmw_kms_restore_vga(dev_priv);
+   vmw_3d_resource_dec(dev_priv);
+   }
 out_no_fifo:
vmw_overlay_close(dev_priv);
vmw_kms_close(dev_priv);
+out_no_kms:
if (dev_priv-stealth)
pci_release_region(dev-pdev, 2);
else
pci_release_regions(dev-pdev);
 out_no_device:
-   if (dev_priv-capabilities  SVGA_CAP_IRQMASK)
-   drm_irq_uninstall(dev_priv-dev);
-   if (dev-devname == vmw_devname)
-   dev-devname = NULL;
-out_no_irq:
ttm_object_device_release(dev_priv-tdev);
 out_err4:
iounmap(dev_priv-mmio_virt);
@@ -460,6 +464,10 @@ static int vmw_driver_unload(struct drm_device *dev)
 
unregister_pm_notifier(dev_priv-pm_nb);
 
+   if (dev_priv-capabilities  SVGA_CAP_IRQMASK)
+   drm_irq_uninstall(dev_priv-dev);
+   if (dev-devname == vmw_devname)
+   dev-devname = NULL;
if (dev_priv-enable_fb) {
vmw_fb_close(dev_priv);
vmw_kms_restore_vga(dev_priv);
@@ -472,10 +480,6 @@ static int vmw_driver_unload(struct drm_device *dev)
else
pci_release_regions(dev-pdev);
 
-   if (dev_priv-capabilities  SVGA_CAP_IRQMASK)
-   drm_irq_uninstall(dev_priv-dev);
-   if (dev-devname == vmw_devname)
-   dev-devname = NULL;
ttm_object_device_release(dev_priv-tdev);
iounmap(dev_priv-mmio_virt);
drm_mtrr_del(dev_priv-mmio_mtrr, dev_priv-mmio_start,
@@ -798,6 +802,7 @@ static struct drm_driver driver = {
.irq_postinstall = vmw_irq_postinstall,
.irq_uninstall = vmw_irq_uninstall,
.irq_handler = vmw_irq_handler,
+   .get_vblank_counter = vmw_get_vblank_counter,
.reclaim_buffers_locked = NULL,
.get_map_ofs = drm_core_get_map_ofs,
.get_reg_ofs = drm_core_get_reg_ofs,
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h 
b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
index 9142454..58de639 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
@@ -518,6 +518,7 @@ void vmw_kms_write_svga(struct vmw_private *vmw_priv,
unsigned bbp, unsigned depth);
 int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv);
+u32 vmw_get_vblank_counter(struct drm_device *dev, int crtc);
 
 /**
  * Overlay control - 

[PATCH 3/4] vmwgfx: Remove initialisation of dev::devname

2010-10-01 Thread Thomas Hellstrom
The removed code causes oopses with newer drms on master drop.

Signed-off-by: Thomas Hellstrom thellst...@vmware.com
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c |6 --
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c 
b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 6bbe703..a96ed6d 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -148,7 +148,6 @@ static struct pci_device_id vmw_pci_id_list[] = {
{0, 0, 0}
 };
 
-static char *vmw_devname = vmwgfx;
 static int enable_fbdev;
 
 static int vmw_probe(struct pci_dev *, const struct pci_device_id *);
@@ -407,9 +406,6 @@ static int vmw_driver_load(struct drm_device *dev, unsigned 
long chipset)
 running the device in SVGA mode yet.\n);
}
 
-   if (!dev-devname)
-   dev-devname = vmw_devname;
-
if (dev_priv-capabilities  SVGA_CAP_IRQMASK) {
ret = drm_irq_install(dev);
if (unlikely(ret != 0)) {
@@ -466,8 +462,6 @@ static int vmw_driver_unload(struct drm_device *dev)
 
if (dev_priv-capabilities  SVGA_CAP_IRQMASK)
drm_irq_uninstall(dev_priv-dev);
-   if (dev-devname == vmw_devname)
-   dev-devname = NULL;
if (dev_priv-enable_fb) {
vmw_fb_close(dev_priv);
vmw_kms_restore_vga(dev_priv);
-- 
1.6.2.5

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 4/4] vmwgfx: Fix fb VRAM pinning failure due to fragmentation

2010-10-01 Thread Thomas Hellstrom
If the soon-to-be scanout buffer is partly covering the intended
VRAM region, move and pin will fail. In that case, just move it out
to system before attempting to move it in again.

Signed-off-by: Thomas Hellstrom thellst...@vmware.com
---
 drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c 
b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
index 870967a..409e172 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
@@ -615,6 +615,11 @@ int vmw_dmabuf_to_start_of_vram(struct vmw_private 
*vmw_priv,
if (unlikely(ret != 0))
goto err_unlock;
 
+   if (bo-mem.mem_type == TTM_PL_VRAM 
+   bo-mem.mm_node-start  bo-num_pages)
+   (void) ttm_bo_validate(bo, vmw_sys_placement, false,
+  false, false);
+
ret = ttm_bo_validate(bo, ne_placement, false, false, false);
 
/* Could probably bug on */
-- 
1.6.2.5

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [git pull] drm fixes

2010-10-01 Thread Dave Airlie

 Hi Linus,
 
 We had an unplanned leak/race finding week:

Updated pull request, TTM extra fix, GEM updated patch with tested by 
lines, and some urgent vmwgfx oops/fixes. (vmwgfx is in staging still, 
though I need to discuss that with vmware).

Dave.


 Had a pretty nasty race in TTM reported (scrolling certain pages in 
 firefox caused a major leak of objects), fix from Thomas in here.
 
 A nasty slow leak in the i915 GEM code, fix from Chris here.
 A race on object deletion in the GEM code, fix from Chris.
 
 A leak/memory corruptor when unloading drm modules after X had started due 
 to using krefs in a non-kref compatible manner, fix from me (found while 
 tracking down the firefox one).
 
 Apart from that, just some general radeon fixes, a BKL regression fix, a 
 vmware regression fix from the ioctl cleanups.
 
The following changes since commit 32163f4b2cef28a5aab8b226ffecfc6379a53786:

  alpha: fix usp value in multithreaded coredumps (2010-09-25 14:38:13 -0700)

are available in the git repository at:
  ssh://master.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git drm-fixes

Alex Deucher (3):
  drm/radeon/kms: fix up encoder info messages for DFP6
  drm/radeon/kms: fix potential segfault in r600_ioctl_wait_idle
  drm/radeon/kms: add quirk for MSI K9A2GM motherboard

Arnd Bergmann (1):
  drm: i810/i830: fix locked ioctl variant

Chris Wilson (2):
  drm: Prune GEM vma entries
  drm: Hold the mutex when dropping the last GEM reference (v2)

Dave Airlie (2):
  drm/radeon: fix PCI ID 5657 to be an RV410
  drm/gem: handlecount isn't really a kref so don't make it one.

Thomas Hellstrom (7):
  drm/ttm: Fix two race conditions
  drm/vmwgfx: Fix breakage introduced by commit drm: block userspace under 
allocating buffer and having drivers overwrite it (v2)
  drm/ttm: Fix missing return
  vmwgfx: vt-switch (master drop) fixes
  vmwgfx: Enable use of the vblank system
  vmwgfx: Remove initialisation of dev::devname
  vmwgfx: Fix fb VRAM pinning failure due to fragmentation

 drivers/gpu/drm/drm_gem.c  |   39 ++--
 drivers/gpu/drm/drm_info.c |2 +-
 drivers/gpu/drm/drm_vm.c   |   28 --
 drivers/gpu/drm/i810/i810_dma.c|2 +-
 drivers/gpu/drm/i830/i830_dma.c|2 +-
 drivers/gpu/drm/i915/i915_gem.c|6 +-
 drivers/gpu/drm/i915/intel_fb.c|4 +-
 drivers/gpu/drm/nouveau/nouveau_fbcon.c|1 +
 drivers/gpu/drm/nouveau/nouveau_gem.c  |6 +-
 drivers/gpu/drm/nouveau/nouveau_notifier.c |1 +
 drivers/gpu/drm/radeon/r600.c  |3 +-
 drivers/gpu/drm/radeon/radeon_atombios.c   |9 ++
 drivers/gpu/drm/radeon/radeon_display.c|5 +-
 drivers/gpu/drm/radeon/radeon_fb.c |   14 +--
 drivers/gpu/drm/radeon/radeon_gem.c|4 +-
 drivers/gpu/drm/ttm/ttm_bo.c   |   75 --
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c|  145 +---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h|8 ++
 drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |5 +
 drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c   |3 +
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c|   17 
 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c|   27 --
 drivers/gpu/drm/vmwgfx/vmwgfx_resource.c   |4 +
 include/drm/drmP.h |   29 --
 include/drm/drm_pciids.h   |2 +-
 include/drm/ttm/ttm_bo_api.h   |4 +-
 26 files changed, 313 insertions(+), 132 deletions(-)
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/ttm: Fix missing return

2010-10-01 Thread Thomas Hellstrom
Hmm. Forget this patch! I must have been extremely tired today. A new 
one coming up in a moment.


/Thomas


On 10/01/2010 10:09 AM, Thomas Hellstrom wrote:

The commit drm/ttm: Fix two race conditions
was missing a return statement in a very unlikely code path.

Signed-off-by: Thomas Hellstromthellst...@vmware.com
---
  drivers/gpu/drm/ttm/ttm_bo.c |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index b98cb2c..d6000d7 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -524,6 +524,7 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object 
*bo, bool remove_all)
atomic_set(bo-reserved, 0);
wake_up_all(bo-event_queue);
spin_unlock(glob-lru_lock);
+   return 0;
}

put_count = ttm_bo_del_from_lru(bo);
   


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/ttm: Fix busy codepaths of the Fix two race conditions commit.

2010-10-01 Thread Thomas Hellstrom
The above mentioned commit didn't queue the buffer on the delayed destroy
list under some rare circumstances. It also didn't completely honor the
remove_all parameter.

Signed-off-by: Thomas Hellstrom thellst...@vmware.com
---
 drivers/gpu/drm/ttm/ttm_bo.c |   15 +++
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index b98cb2c..db809e0 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -493,6 +493,7 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object 
*bo, bool remove_all)
int ret;
 
spin_lock(bo-lock);
+retry:
(void) ttm_bo_wait(bo, false, false, !remove_all);
 
if (!bo-sync_obj) {
@@ -501,15 +502,16 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object 
*bo, bool remove_all)
spin_unlock(bo-lock);
 
spin_lock(glob-lru_lock);
-   ret = ttm_bo_reserve_locked(bo, false, true, false, 0);
+   ret = ttm_bo_reserve_locked(bo, false, !remove_all, false, 0);
 
/**
 * Someone else has the object reserved. Bail and retry.
 */
 
-   if (unlikely(ret != 0)) {
+   if (unlikely(ret == -EBUSY)) {
spin_unlock(glob-lru_lock);
-   return 0;
+   spin_lock(bo-lock);
+   goto requeue;
}
 
/**
@@ -524,6 +526,11 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object 
*bo, bool remove_all)
atomic_set(bo-reserved, 0);
wake_up_all(bo-event_queue);
spin_unlock(glob-lru_lock);
+   spin_lock(bo-lock);
+   if (remove_all)
+   goto retry;
+   else
+   goto requeue;
}
 
put_count = ttm_bo_del_from_lru(bo);
@@ -540,7 +547,7 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object 
*bo, bool remove_all)
 
return 0;
}
-
+requeue:
spin_lock(glob-lru_lock);
if (list_empty(bo-ddestroy)) {
void *sync_obj = bo-sync_obj;
-- 
1.6.2.5

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [git pull] drm fixes

2010-10-01 Thread Dave Airlie

  
  We had an unplanned leak/race finding week:
 
 Updated pull request, TTM extra fix, GEM updated patch with tested by 
 lines, and some urgent vmwgfx oops/fixes. (vmwgfx is in staging still, 
 though I need to discuss that with vmware).

Today is proof the phenylephrine is a poor substitute for pseudoephedrine, 
and both are a poor substitute for sleep.

I've dropped the TTM fixes until next week since Thomas keeps finding 
corner-case issues and I'd like to get to my test box in the office and 
confirm, we know the patch fixes a major leak, just a matter of having 
more confidence in it working in the corners.

Lets get the simpler patches I'm sure about in and I'll send the ttm leak 
fix on its own next week.

Dave.

The following changes since commit 32163f4b2cef28a5aab8b226ffecfc6379a53786:

  alpha: fix usp value in multithreaded coredumps (2010-09-25 14:38:13 -0700)

are available in the git repository at:
  ssh://master.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git drm-fixes

Alex Deucher (3):
  drm/radeon/kms: fix up encoder info messages for DFP6
  drm/radeon/kms: fix potential segfault in r600_ioctl_wait_idle
  drm/radeon/kms: add quirk for MSI K9A2GM motherboard

Arnd Bergmann (1):
  drm: i810/i830: fix locked ioctl variant

Chris Wilson (2):
  drm: Prune GEM vma entries
  drm: Hold the mutex when dropping the last GEM reference (v2)

Dave Airlie (2):
  drm/radeon: fix PCI ID 5657 to be an RV410
  drm/gem: handlecount isn't really a kref so don't make it one.

Thomas Hellstrom (5):
  drm/vmwgfx: Fix breakage introduced by commit drm: block userspace under 
allocating buffer and having drivers overwrite it (v2)
  vmwgfx: vt-switch (master drop) fixes
  vmwgfx: Enable use of the vblank system
  vmwgfx: Remove initialisation of dev::devname
  vmwgfx: Fix fb VRAM pinning failure due to fragmentation

 drivers/gpu/drm/drm_gem.c  |   39 ++--
 drivers/gpu/drm/drm_info.c |2 +-
 drivers/gpu/drm/drm_vm.c   |   28 --
 drivers/gpu/drm/i810/i810_dma.c|2 +-
 drivers/gpu/drm/i830/i830_dma.c|2 +-
 drivers/gpu/drm/i915/i915_gem.c|6 +-
 drivers/gpu/drm/i915/intel_fb.c|4 +-
 drivers/gpu/drm/nouveau/nouveau_fbcon.c|1 +
 drivers/gpu/drm/nouveau/nouveau_gem.c  |6 +-
 drivers/gpu/drm/nouveau/nouveau_notifier.c |1 +
 drivers/gpu/drm/radeon/r600.c  |3 +-
 drivers/gpu/drm/radeon/radeon_atombios.c   |9 ++
 drivers/gpu/drm/radeon/radeon_display.c|5 +-
 drivers/gpu/drm/radeon/radeon_fb.c |   14 +--
 drivers/gpu/drm/radeon/radeon_gem.c|4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c|  145 +---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h|8 ++
 drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |5 +
 drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c   |3 +
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c|   17 
 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c|   27 --
 drivers/gpu/drm/vmwgfx/vmwgfx_resource.c   |4 +
 include/drm/drmP.h |   29 --
 include/drm/drm_pciids.h   |2 +-
 24 files changed, 246 insertions(+), 120 deletions(-)
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] DRM: ignore invalid EDID extensions

2010-10-01 Thread Sam Tygier

On 22/09/10 22:55, Adam Jackson wrote:

Yeah, I hate to just drop extension blocks, but it's better than the
alternative.  They're optional for a reason I suppose.


For my EIZO S2242W the base block is fine, but the extension block is
all zeros. Without this patch I get no X and no VTs.


I suspect what's actually happening there is that we're failing to get
the extension block, not that it's being returned as zeros.


Could this be fixed? Anything I could try?


Depends on what your driver is, I suspect.  Did it ever work?

- ajax


I have git bisected, which takes me to

61e57a8d72f2336faf39b5d940215cf085e01e6e is the first bad commit
commit 61e57a8d72f2336faf39b5d940215cf085e01e6e
Author: Adam Jackson a...@redhat.com
Date:   Mon Mar 29 21:43:18 2010 +

drm/edid: Fix secondary block fetch.

This makes fetching the second EDID block on HDMI monitors actually

work.  DDC can't transfer more than 128 bytes at a time.  Also,
rearrange the code so the pure DDC bits are separate from block parse.

Signed-off-by: Adam Jackson a...@redhat.com

Signed-off-by: Dave Airlie airl...@redhat.com

:04 04 a0b022ba678bd92c46e2ecba63d5f2c78f69b0c3 
77e672eec31b83465f6fe8ee3ca6c0153a0af230 M  drivers
:04 04 99e72b1f7f6b4016606ed3388b902a5f39b9c13b 
3b1e49f0fb674e4974a77021bc90dfce7098ecc6 M  include

full log

git bisect start
# good: [e40152ee1e1c7a63f491863215e3faa37a86] Linus 2.6.34
git bisect good e40152ee1e1c7a63f491863215e3faa37a86
# bad: [815c4163b6c8ebf8152f42b0a5fd015cfdcedc78] Linux 2.6.35-rc4
git bisect bad 815c4163b6c8ebf8152f42b0a5fd015cfdcedc78
# good: [c316ba3b518bc35ce5aef5421135220389f4eb98] Merge branch 'linux-next' of 
git://git.infradead.org/ubi-2.6
git bisect good c316ba3b518bc35ce5aef5421135220389f4eb98
# bad: [6d94d4081048756df78444a07201156f4930fe48] lis3: interrupt handlers for 
8bit wakeup and click events
git bisect bad 6d94d4081048756df78444a07201156f4930fe48
# bad: [6e80e8ed5eb92d0112674aabe82951266a6a1051] Merge branch 'for-2.6.35' of 
git://git.kernel.dk/linux-2.6-block
git bisect bad 6e80e8ed5eb92d0112674aabe82951266a6a1051
# good: [ac3ee84c604502240122c47b52f0542ec8774f15] Merge branch 
'dbg-early-merge' of 
git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb
git bisect good ac3ee84c604502240122c47b52f0542ec8774f15
# bad: [59534f7298c5e28aaa64e6ed550e247f64ee72ae] Merge branch 'drm-for-2.6.35' 
of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
git bisect bad 59534f7298c5e28aaa64e6ed550e247f64ee72ae
# bad: [7547a917fa5f3b2406f52c7dcf7ec9ad3c8532eb] Merge branch 
'drm-ttm-unmappable' into drm-core-next
git bisect bad 7547a917fa5f3b2406f52c7dcf7ec9ad3c8532eb
# good: [c2b41276da65481d36311a13d69020d150861c43] Merge branch 'drm-ttm-pool' 
into drm-core-next
git bisect good c2b41276da65481d36311a13d69020d150861c43
# bad: [7fff400be6fbf64f10abca9939718aaf1d61c255] Merge branch 
'drm-fbdev-cleanup' into drm-core-next
git bisect bad 7fff400be6fbf64f10abca9939718aaf1d61c255
# bad: [171fdd892979081e8a9b1a67ce86c7008b7abbdf] drm/modes: Fix interlaced 
mode names
git bisect bad 171fdd892979081e8a9b1a67ce86c7008b7abbdf
# bad: [59d8aff6e4fc2705053e7ce2948b51f7fe507536] drm/edid: Remove some silly 
comments
git bisect bad 59d8aff6e4fc2705053e7ce2948b51f7fe507536
# bad: [2b470ab075b30aaeeab29d67b8f1f111096a5fbe] drm/edid: Remove a redundant 
check
git bisect bad 2b470ab075b30aaeeab29d67b8f1f111096a5fbe
# bad: [fbcc06b6439024b967cf6927b95d303f4c3c1a4f] drm/edid: Remove some 
misleading comments
git bisect bad fbcc06b6439024b967cf6927b95d303f4c3c1a4f
# bad: [61e57a8d72f2336faf39b5d940215cf085e01e6e] drm/edid: Fix secondary block 
fetch.
git bisect bad 61e57a8d72f2336faf39b5d940215cf085e01e6e

before 61e57a8d72f2336faf39b5d940215cf085e01e6e, the monitor is detected and 
gives the correct resolution and everything boots normally with kms.

after i get the
radeon :08:00.0: DVI-I-1: EDID block 1 invalid.
and no X or VTs, unless i disable KMS (in which case it boots fine)

Is there anything else you want me to test? would it be helpful for me to start 
a bug on fdo?

Thanks

Sam

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 30551] r600c: Segfaults with Evergreen

2010-10-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=30551

Alex Deucher ag...@yahoo.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #1 from Alex Deucher ag...@yahoo.com 2010-10-01 17:15:51 PDT ---
fixed in fb0eed84cac3cdb45bd0b46047fc389b81a5b1df

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm: Prune GEM vma entries

2010-10-01 Thread Matt Mackall
On Mon, 2010-09-27 at 21:08 +0100, Chris Wilson wrote:
 Hook the GEM vm open/close ops into the generic drm vm open/close so
 that the vma entries are created and destroy appropriately.
 
 Reported-by: Matt Mackall m...@selenic.com
 Cc: Dave Airlie airl...@redhat.com
 Cc: Jesse Barnes jbar...@virtuousgeek.org
 Signed-off-by: Chris Wilson ch...@chris-wilson.co.uk

All signs point to this being the correct fix, but I won't have time to
test it while I'm in Japan.

Paul, does this work for you?

 ---
  drivers/gpu/drm/drm_gem.c |9 -
  drivers/gpu/drm/drm_vm.c  |   28 ++--
  include/drm/drmP.h|1 +
  3 files changed, 27 insertions(+), 11 deletions(-)
 
 diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
 index bf92d07..6fe2cd2 100644
 --- a/drivers/gpu/drm/drm_gem.c
 +++ b/drivers/gpu/drm/drm_gem.c
 @@ -528,6 +528,10 @@ void drm_gem_vm_open(struct vm_area_struct *vma)
   struct drm_gem_object *obj = vma-vm_private_data;
  
   drm_gem_object_reference(obj);
 +
 + mutex_lock(obj-dev-struct_mutex);
 + drm_vm_open_locked(vma);
 + mutex_unlock(obj-dev-struct_mutex);
  }
  EXPORT_SYMBOL(drm_gem_vm_open);
  
 @@ -535,7 +539,10 @@ void drm_gem_vm_close(struct vm_area_struct *vma)
  {
   struct drm_gem_object *obj = vma-vm_private_data;
  
 - drm_gem_object_unreference_unlocked(obj);
 + mutex_lock(obj-dev-struct_mutex);
 + drm_vm_close_locked(vma);
 + drm_gem_object_unreference(obj);
 + mutex_unlock(obj-dev-struct_mutex);
  }
  EXPORT_SYMBOL(drm_gem_vm_close);
  
 diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
 index fda6746..5df4506 100644
 --- a/drivers/gpu/drm/drm_vm.c
 +++ b/drivers/gpu/drm/drm_vm.c
 @@ -433,15 +433,7 @@ static void drm_vm_open(struct vm_area_struct *vma)
   mutex_unlock(dev-struct_mutex);
  }
  
 -/**
 - * \c close method for all virtual memory types.
 - *
 - * \param vma virtual memory area.
 - *
 - * Search the \p vma private data entry in drm_device::vmalist, unlink it, 
 and
 - * free it.
 - */
 -static void drm_vm_close(struct vm_area_struct *vma)
 +void drm_vm_close_locked(struct vm_area_struct *vma)
  {
   struct drm_file *priv = vma-vm_file-private_data;
   struct drm_device *dev = priv-minor-dev;
 @@ -451,7 +443,6 @@ static void drm_vm_close(struct vm_area_struct *vma)
 vma-vm_start, vma-vm_end - vma-vm_start);
   atomic_dec(dev-vma_count);
  
 - mutex_lock(dev-struct_mutex);
   list_for_each_entry_safe(pt, temp, dev-vmalist, head) {
   if (pt-vma == vma) {
   list_del(pt-head);
 @@ -459,6 +450,23 @@ static void drm_vm_close(struct vm_area_struct *vma)
   break;
   }
   }
 +}
 +
 +/**
 + * \c close method for all virtual memory types.
 + *
 + * \param vma virtual memory area.
 + *
 + * Search the \p vma private data entry in drm_device::vmalist, unlink it, 
 and
 + * free it.
 + */
 +static void drm_vm_close(struct vm_area_struct *vma)
 +{
 + struct drm_file *priv = vma-vm_file-private_data;
 + struct drm_device *dev = priv-minor-dev;
 +
 + mutex_lock(dev-struct_mutex);
 + drm_vm_close_locked(vma);
   mutex_unlock(dev-struct_mutex);
  }
  
 diff --git a/include/drm/drmP.h b/include/drm/drmP.h
 index 7809d23..774e1d4 100644
 --- a/include/drm/drmP.h
 +++ b/include/drm/drmP.h
 @@ -1175,6 +1175,7 @@ extern int drm_release(struct inode *inode, struct file 
 *filp);
  extern int drm_mmap(struct file *filp, struct vm_area_struct *vma);
  extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma);
  extern void drm_vm_open_locked(struct vm_area_struct *vma);
 +extern void drm_vm_close_locked(struct vm_area_struct *vma);
  extern resource_size_t drm_core_get_map_ofs(struct drm_local_map * map);
  extern resource_size_t drm_core_get_reg_ofs(struct drm_device *dev);
  extern unsigned int drm_poll(struct file *filp, struct poll_table_struct 
 *wait);


-- 
Mathematics is the supreme nostalgia of our time.


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel