linux-alpha.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Need help fixing DRM locking on Alpha
@ 2009-02-09 21:43 Matt Turner
  2009-02-10 15:43 ` Ivan Kokshaysky
  0 siblings, 1 reply; 12+ messages in thread
From: Matt Turner @ 2009-02-09 21:43 UTC (permalink / raw)
  To: Ivan Kokshaysky; +Cc: linux-alpha

Hi,

Lately, I've spent time debugging a problem with the DRM locking code on Alpha.

http://bugs.freedesktop.org/show_bug.cgi?id=16549

After searching through the userspace components (libdrm, mesa,
xserver) and not finding any relevant changes, I think the problem
must be located in the kernel.

David Airlie pointed me to possibly relevant commits to alpha's
system.h which contains cmpxchg.

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=history;f=include/asm-alpha/system.h;h=afe20fa58c990927fd10c5e94d41fe4d8d9eee8a;hb=HEAD

Can anyone see where the bug is located?

Thanks,

Matt Turner

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Need help fixing DRM locking on Alpha
  2009-02-09 21:43 Need help fixing DRM locking on Alpha Matt Turner
@ 2009-02-10 15:43 ` Ivan Kokshaysky
  2009-02-10 23:18   ` Matt Turner
  0 siblings, 1 reply; 12+ messages in thread
From: Ivan Kokshaysky @ 2009-02-10 15:43 UTC (permalink / raw)
  To: Matt Turner; +Cc: linux-alpha

On Mon, Feb 09, 2009 at 04:43:12PM -0500, Matt Turner wrote:
> Hi,
> 
> Lately, I've spent time debugging a problem with the DRM locking code on Alpha.
> 
> http://bugs.freedesktop.org/show_bug.cgi?id=16549
> 
> After searching through the userspace components (libdrm, mesa,
> xserver) and not finding any relevant changes, I think the problem
> must be located in the kernel.
> 
> David Airlie pointed me to possibly relevant commits to alpha's
> system.h which contains cmpxchg.
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=history;f=include/asm-alpha/system.h;h=afe20fa58c990927fd10c5e94d41fe4d8d9eee8a;hb=HEAD

No, I believe that at least __cmpxchg_u32/u64 kernel code is OK.
Perhaps there are problems with __cmpxchg_u8/u16, but I don't
think DRM locking code uses those.

> Can anyone see where the bug is located?

Hm, DRM_CAS looks suspicious - I'm not sure if it behaves as expected
in the contention case. But your change to it is incorrect either,
since you ignore the return value of stl_c.

Assuming that x86 and powerpc implementations do the correct thing, we need
something like this (untested!). Basically, it's cmpxchg with an inverted
return value. Also we need to be careful with sign-extension.

#define	DRM_CAS(lock, old, new, ret)		\
	do {					\
		int tmp;			\
		__asm__ __volatile__(		\
		"	addl	$31, %3, %3\n"	\
		"1:	ldl_l	%0, %2\n"	\
		"	cmpeq	%0, %3, %1\n"	\
		"	beq	%1, 2f\n"	\
		"	mov	%4, %0\n"	\
		"	stl_c	%0, %2\n"	\
		"	beq	%0, 3f\n"	\
		"2:	mb\n"			\
		"	cmpeq	%1, 0, %1\n"	\
		".subsection 2\n"		\
		"3:	br	1b\n"		\
		".previous"			\
		: "=&r"(tmp), "=&r"(ret),	\
		  "=m"(__drm_dummy_lock(lock)),	\
		  "=&r"(old)			\
		: "r"(new)			\
		: "memory");			\
	} while (0)

Ivan.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Need help fixing DRM locking on Alpha
  2009-02-10 15:43 ` Ivan Kokshaysky
@ 2009-02-10 23:18   ` Matt Turner
  2009-02-11 15:48     ` Ivan Kokshaysky
  2009-02-11 21:29     ` Michael Cree
  0 siblings, 2 replies; 12+ messages in thread
From: Matt Turner @ 2009-02-10 23:18 UTC (permalink / raw)
  To: Ivan Kokshaysky; +Cc: linux-alpha

Hi Ivan,

Your code fixes the problem. Thanks!

I had to make one minor change though: moved 'old' from an output to
an input. That is,

>                 "=m"(__drm_dummy_lock(lock)), \
>                 "=&r"(old)                    \
>               : "r"(new)                      \

becomes

>		  "=m"(__drm_dummy_lock(lock))	\
>		: "r"(old), "r"(new)		\

Please let me know if this change is acceptable. If so, please submit
a patch to the bug report so that proper credit is given to you.

I'm successfully running xserver-1.5.3, mesa-7.2, libdrm-2.4.4, and
xf86-video-ati-6.9.0 with DRI enabled on my UP1500 with a Radeon 9800
AGP. (1230 FPS reported by glxgears :) Next stop is writing an Alpha
virtual machine for Quake 3 :)

Thanks so much,

Matt Turner

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Need help fixing DRM locking on Alpha
  2009-02-10 23:18   ` Matt Turner
@ 2009-02-11 15:48     ` Ivan Kokshaysky
       [not found]       ` <b4198de60902111401x62c6eea0u8a0d02d12383ec@mail.gmail.com>
  2009-02-12 22:15       ` Matt Turner
  2009-02-11 21:29     ` Michael Cree
  1 sibling, 2 replies; 12+ messages in thread
From: Ivan Kokshaysky @ 2009-02-11 15:48 UTC (permalink / raw)
  To: Matt Turner; +Cc: linux-alpha

On Tue, Feb 10, 2009 at 06:18:43PM -0500, Matt Turner wrote:
> Your code fixes the problem. Thanks!

Great news!

> I had to make one minor change though: moved 'old' from an output to
> an input. That is,
> 
> >                 "=m"(__drm_dummy_lock(lock)), \
> >                 "=&r"(old)                    \
> >               : "r"(new)                      \
> 
> becomes
> 
> >		  "=m"(__drm_dummy_lock(lock))	\
> >		: "r"(old), "r"(new)		\

Yes, you are right. But strictly speaking, "old" should be both input
and output operand.
 
> Please let me know if this change is acceptable. If so, please submit
> a patch to the bug report so that proper credit is given to you.

Well, I've got slightly improved version, which saves one instruction
for register-register move. Another instruction can be saved if we
define DRM_CAS_RESULT(_result) as "long" (no need for sign extending then).

Can you test this please?

Ivan.

--- libdrm-2.4.4/libdrm/xf86drm.h.orig	Wed Dec 17 21:28:24 2008
+++ libdrm-2.4.4/libdrm/xf86drm.h	Wed Feb 11 03:07:05 2009
@@ -325,28 +325,28 @@ typedef struct _drmSetVersion {
 
 #elif defined(__alpha__)
 
-#define	DRM_CAS(lock, old, new, ret) 		\
- 	do {					\
- 		int old32;                      \
- 		int cur32;			\
- 		__asm__ __volatile__(		\
- 		"       mb\n"			\
- 		"       zap   %4, 0xF0, %0\n"   \
- 		"       ldl_l %1, %2\n"		\
- 		"       zap   %1, 0xF0, %1\n"   \
-                "       cmpeq %0, %1, %1\n"	\
-                "       beq   %1, 1f\n"		\
- 		"       bis   %5, %5, %1\n"	\
-                "       stl_c %1, %2\n"		\
-                "1:     xor   %1, 1, %1\n"	\
-                "       stl   %1, %3"		\
-                : "=r" (old32),                 \
-		  "=&r" (cur32),		\
-                   "=m" (__drm_dummy_lock(lock)),\
-                   "=m" (ret)			\
- 		: "r" (old),			\
- 		  "r" (new));			\
- 	} while(0)
+#define	DRM_CAS(lock, old, new, ret)		\
+	do {					\
+		int tmp, old32;			\
+		__asm__ __volatile__(		\
+		"	addl	$31, %5, %3\n"	\
+		"1:	ldl_l	%0, %2\n"	\
+		"	cmpeq	%0, %3, %1\n"	\
+		"	beq	%1, 2f\n"	\
+		"	mov	%4, %0\n"	\
+		"	stl_c	%0, %2\n"	\
+		"	beq	%0, 3f\n"	\
+		"	mb\n"			\
+		"2:	cmpeq	%1, 0, %1\n"	\
+		".subsection 2\n"		\
+		"3:	br	1b\n"		\
+		".previous"			\
+		: "=&r"(tmp), "=&r"(ret),	\
+		  "=m"(__drm_dummy_lock(lock)),	\
+		  "=&r"(old32)			\
+		: "r"(new), "r"(old)		\
+		: "memory");			\
+	} while (0)
 
 #elif defined(__sparc__)
 
@@ -429,7 +429,9 @@ do {	register unsigned int __old __asm("
 #define DRM_CAS(lock,old,new,ret) do { ret=1; } while (0) /* FAST LOCK FAILS */
 #endif
 
-#if defined(__alpha__) || defined(__powerpc__)
+#if defined(__alpha__)
+#define DRM_CAS_RESULT(_result)		long _result
+#elif defined(__powerpc__)
 #define DRM_CAS_RESULT(_result)		int _result
 #else
 #define DRM_CAS_RESULT(_result)		char _result

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Need help fixing DRM locking on Alpha
  2009-02-10 23:18   ` Matt Turner
  2009-02-11 15:48     ` Ivan Kokshaysky
@ 2009-02-11 21:29     ` Michael Cree
  2009-02-12  7:31       ` Oliver Falk
  1 sibling, 1 reply; 12+ messages in thread
From: Michael Cree @ 2009-02-11 21:29 UTC (permalink / raw)
  To: Matt Turner; +Cc: Ivan Kokshaysky, linux-alpha

On 11/02/2009, at 12:18 PM, Matt Turner wrote:
> Your code fixes the problem. Thanks!

Nice work guys.  DRM on alpha has been broken for quite a while.  Be  
nice to see it going again!

I see the patch for pci resource files on sysfs has appeared.  Just  
compiled the latest kernel (...29-rc4) with the patch and I have  
resource files on my ev56 system.  I am not able to install xserver  
1.5 yet - the Debian experimental branch which contains the latest  
xserver has broken dependencies for Alpha (and I don't have time to do  
a build of the xserver myself).

But I did discover that the rhd_dump program from the radeonhd  
project, which used to dump zeroes only, now dumps what looks like  
useful information from my radeon hd2400 graphics card.  (The card  
still doesn't POST properly but that's probably an issue of upgrading  
the xserver - I seem to remember seeing a number of POST issues in  
changelogs at some point.)

Cheers
Michael.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Fwd: Need help fixing DRM locking on Alpha
       [not found]       ` <b4198de60902111401x62c6eea0u8a0d02d12383ec@mail.gmail.com>
@ 2009-02-11 22:13         ` Matt Turner
       [not found]         ` <b4198de60902111412o79479f6av7740552f5b0e9dc8@mail.gmail.com>
  1 sibling, 0 replies; 12+ messages in thread
From: Matt Turner @ 2009-02-11 22:13 UTC (permalink / raw)
  To: linux-alpha

Hi Ivan,

On Wed, Feb 11, 2009 at 10:48 AM, Ivan Kokshaysky
<ink@jurassic.park.msu.ru> wrote:
> Well, I've got slightly improved version, which saves one instruction
> for register-register move. Another instruction can be saved if we
> define DRM_CAS_RESULT(_result) as "long" (no need for sign extending then).
>
> Can you test this please?
>
> Ivan.
>
> --- libdrm-2.4.4/libdrm/xf86drm.h.orig  Wed Dec 17 21:28:24 2008
> +++ libdrm-2.4.4/libdrm/xf86drm.h       Wed Feb 11 03:07:05 2009
> @@ -325,28 +325,28 @@ typedef struct _drmSetVersion {
>
>  #elif defined(__alpha__)
>
> -#define        DRM_CAS(lock, old, new, ret)            \
> -       do {                                    \
> -               int old32;                      \
> -               int cur32;                      \
> -               __asm__ __volatile__(           \
> -               "       mb\n"                   \
> -               "       zap   %4, 0xF0, %0\n"   \
> -               "       ldl_l %1, %2\n"         \
> -               "       zap   %1, 0xF0, %1\n"   \
> -                "       cmpeq %0, %1, %1\n"    \
> -                "       beq   %1, 1f\n"                \
> -               "       bis   %5, %5, %1\n"     \
> -                "       stl_c %1, %2\n"                \
> -                "1:     xor   %1, 1, %1\n"     \
> -                "       stl   %1, %3"          \
> -                : "=r" (old32),                 \
> -                 "=&r" (cur32),                \
> -                   "=m" (__drm_dummy_lock(lock)),\
> -                   "=m" (ret)                  \
> -               : "r" (old),                    \
> -                 "r" (new));                   \
> -       } while(0)
> +#define        DRM_CAS(lock, old, new, ret)            \
> +       do {                                    \
> +               int tmp, old32;                 \
> +               __asm__ __volatile__(           \
> +               "       addl    $31, %5, %3\n"  \
> +               "1:     ldl_l   %0, %2\n"       \
> +               "       cmpeq   %0, %3, %1\n"   \
> +               "       beq     %1, 2f\n"       \
> +               "       mov     %4, %0\n"       \
> +               "       stl_c   %0, %2\n"       \
> +               "       beq     %0, 3f\n"       \
> +               "       mb\n"                   \
> +               "2:     cmpeq   %1, 0, %1\n"    \
> +               ".subsection 2\n"               \
> +               "3:     br      1b\n"           \
> +               ".previous"                     \
> +               : "=&r"(tmp), "=&r"(ret),       \
> +                 "=m"(__drm_dummy_lock(lock)), \
> +                 "=&r"(old32)                  \
> +               : "r"(new), "r"(old)            \
> +               : "memory");                    \
> +       } while (0)
>
>  #elif defined(__sparc__)
>
> @@ -429,7 +429,9 @@ do {        register unsigned int __old __asm("
>  #define DRM_CAS(lock,old,new,ret) do { ret=1; } while (0) /* FAST LOCK FAILS */
>  #endif
>
> -#if defined(__alpha__) || defined(__powerpc__)
> +#if defined(__alpha__)
> +#define DRM_CAS_RESULT(_result)                long _result
> +#elif defined(__powerpc__)
>  #define DRM_CAS_RESULT(_result)                int _result
>  #else
>  #define DRM_CAS_RESULT(_result)                char _result
>

I changed 'old32' to 'old' for the %3 output argument, but it fails to
compile with

> error: lvalue required in asm statement
> error: invalid lvalue in asm output 3

I saw this error with the first patch as well, but it was easily
avoided by changing old to an input. I'd fix it, but I don't know what
the appropriate thing is.

Thanks,

Matt Turner

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Need help fixing DRM locking on Alpha
       [not found]         ` <b4198de60902111412o79479f6av7740552f5b0e9dc8@mail.gmail.com>
@ 2009-02-11 22:13           ` Matt Turner
  0 siblings, 0 replies; 12+ messages in thread
From: Matt Turner @ 2009-02-11 22:13 UTC (permalink / raw)
  To: linux-alpha

Sorry for replying to my own mail. I should have said this before.

That error comes when compiling drmstat.c (line 376).

Also, libdrm has no dependencies, so the patches should be easy to compile test.

Thanks again,

Matt Turner

On Wed, Feb 11, 2009 at 5:01 PM, Matt Turner <mattst88@gmail.com> wrote:
> Hi Ivan,
>
> On Wed, Feb 11, 2009 at 10:48 AM, Ivan Kokshaysky
> <ink@jurassic.park.msu.ru> wrote:
>> Well, I've got slightly improved version, which saves one instruction
>> for register-register move. Another instruction can be saved if we
>> define DRM_CAS_RESULT(_result) as "long" (no need for sign extending then).
>>
>> Can you test this please?
>>
>> Ivan.
>>
>> --- libdrm-2.4.4/libdrm/xf86drm.h.orig  Wed Dec 17 21:28:24 2008
>> +++ libdrm-2.4.4/libdrm/xf86drm.h       Wed Feb 11 03:07:05 2009
>> @@ -325,28 +325,28 @@ typedef struct _drmSetVersion {
>>
>>  #elif defined(__alpha__)
>>
>> -#define        DRM_CAS(lock, old, new, ret)            \
>> -       do {                                    \
>> -               int old32;                      \
>> -               int cur32;                      \
>> -               __asm__ __volatile__(           \
>> -               "       mb\n"                   \
>> -               "       zap   %4, 0xF0, %0\n"   \
>> -               "       ldl_l %1, %2\n"         \
>> -               "       zap   %1, 0xF0, %1\n"   \
>> -                "       cmpeq %0, %1, %1\n"    \
>> -                "       beq   %1, 1f\n"                \
>> -               "       bis   %5, %5, %1\n"     \
>> -                "       stl_c %1, %2\n"                \
>> -                "1:     xor   %1, 1, %1\n"     \
>> -                "       stl   %1, %3"          \
>> -                : "=r" (old32),                 \
>> -                 "=&r" (cur32),                \
>> -                   "=m" (__drm_dummy_lock(lock)),\
>> -                   "=m" (ret)                  \
>> -               : "r" (old),                    \
>> -                 "r" (new));                   \
>> -       } while(0)
>> +#define        DRM_CAS(lock, old, new, ret)            \
>> +       do {                                    \
>> +               int tmp, old32;                 \
>> +               __asm__ __volatile__(           \
>> +               "       addl    $31, %5, %3\n"  \
>> +               "1:     ldl_l   %0, %2\n"       \
>> +               "       cmpeq   %0, %3, %1\n"   \
>> +               "       beq     %1, 2f\n"       \
>> +               "       mov     %4, %0\n"       \
>> +               "       stl_c   %0, %2\n"       \
>> +               "       beq     %0, 3f\n"       \
>> +               "       mb\n"                   \
>> +               "2:     cmpeq   %1, 0, %1\n"    \
>> +               ".subsection 2\n"               \
>> +               "3:     br      1b\n"           \
>> +               ".previous"                     \
>> +               : "=&r"(tmp), "=&r"(ret),       \
>> +                 "=m"(__drm_dummy_lock(lock)), \
>> +                 "=&r"(old32)                  \
>> +               : "r"(new), "r"(old)            \
>> +               : "memory");                    \
>> +       } while (0)
>>
>>  #elif defined(__sparc__)
>>
>> @@ -429,7 +429,9 @@ do {        register unsigned int __old __asm("
>>  #define DRM_CAS(lock,old,new,ret) do { ret=1; } while (0) /* FAST LOCK FAILS */
>>  #endif
>>
>> -#if defined(__alpha__) || defined(__powerpc__)
>> +#if defined(__alpha__)
>> +#define DRM_CAS_RESULT(_result)                long _result
>> +#elif defined(__powerpc__)
>>  #define DRM_CAS_RESULT(_result)                int _result
>>  #else
>>  #define DRM_CAS_RESULT(_result)                char _result
>>
>
> I changed 'old32' to 'old' for the %3 output argument, but it fails to
> compile with
>
>> error: lvalue required in asm statement
>> error: invalid lvalue in asm output 3
>
> I saw this error with the first patch as well, but it was easily
> avoided by changing old to an input. I'd fix it, but I don't know what
> the appropriate thing is.
>
> Thanks,
>
> Matt Turner
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Need help fixing DRM locking on Alpha
  2009-02-11 21:29     ` Michael Cree
@ 2009-02-12  7:31       ` Oliver Falk
  2009-02-12  7:43         ` Michael Cree
  0 siblings, 1 reply; 12+ messages in thread
From: Oliver Falk @ 2009-02-12  7:31 UTC (permalink / raw)
  To: Michael Cree; +Cc: Matt Turner, Ivan Kokshaysky, linux-alpha

Michael Cree wrote:
> On 11/02/2009, at 12:18 PM, Matt Turner wrote:
>> Your code fixes the problem. Thanks!
> 
> Nice work guys.  DRM on alpha has been broken for quite a while.  Be 
> nice to see it going again!
> 
> I see the patch for pci resource files on sysfs has appeared.  Just 
> compiled the latest kernel (...29-rc4) with the patch and I have 
> resource files on my ev56 system.  I am not able to install xserver 1.5 
> yet - the Debian experimental branch which contains the latest xserver 
> has broken dependencies for Alpha (and I don't have time to do a build 
> of the xserver myself).
> 
> But I did discover that the rhd_dump program from the radeonhd project, 
> which used to dump zeroes only, now dumps what looks like useful 
> information from my radeon hd2400 graphics card.  (The card still 
> doesn't POST properly but that's probably an issue of upgrading the 
> xserver - I seem to remember seeing a number of POST issues in 
> changelogs at some point.)

Well. This means, it would make sense to at least try to apply the patch 
you mentioned to the kernel and try to start xsrv 1.5.

Do you have any link to the patch?

-of

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Need help fixing DRM locking on Alpha
  2009-02-12  7:31       ` Oliver Falk
@ 2009-02-12  7:43         ` Michael Cree
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Cree @ 2009-02-12  7:43 UTC (permalink / raw)
  To: Oliver Falk; +Cc: Matt Turner, Ivan Kokshaysky, linux-alpha

Oliver Falk wrote:
> Well. This means, it would make sense to at least try to apply the 
> patch you mentioned to the kernel and try to start xsrv 1.5.
>
> Do you have any link to the patch?

Can be found at:

http://bugzilla.kernel.org/show_bug.cgi?id=10893

Cheers
Michael.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Need help fixing DRM locking on Alpha
  2009-02-11 15:48     ` Ivan Kokshaysky
       [not found]       ` <b4198de60902111401x62c6eea0u8a0d02d12383ec@mail.gmail.com>
@ 2009-02-12 22:15       ` Matt Turner
  2009-02-16 20:37         ` Michael Cree
  1 sibling, 1 reply; 12+ messages in thread
From: Matt Turner @ 2009-02-12 22:15 UTC (permalink / raw)
  To: Ivan Kokshaysky; +Cc: linux-alpha, klausman

Hi,

> --- libdrm-2.4.4/libdrm/xf86drm.h.orig  Wed Dec 17 21:28:24 2008
> +++ libdrm-2.4.4/libdrm/xf86drm.h       Wed Feb 11 03:07:05 2009
> @@ -325,28 +325,28 @@ typedef struct _drmSetVersion {
>
>  #elif defined(__alpha__)
>
> -#define        DRM_CAS(lock, old, new, ret)            \
> -       do {                                    \
> -               int old32;                      \
> -               int cur32;                      \
> -               __asm__ __volatile__(           \
> -               "       mb\n"                   \
> -               "       zap   %4, 0xF0, %0\n"   \
> -               "       ldl_l %1, %2\n"         \
> -               "       zap   %1, 0xF0, %1\n"   \
> -                "       cmpeq %0, %1, %1\n"    \
> -                "       beq   %1, 1f\n"                \
> -               "       bis   %5, %5, %1\n"     \
> -                "       stl_c %1, %2\n"                \
> -                "1:     xor   %1, 1, %1\n"     \
> -                "       stl   %1, %3"          \
> -                : "=r" (old32),                 \
> -                 "=&r" (cur32),                \
> -                   "=m" (__drm_dummy_lock(lock)),\
> -                   "=m" (ret)                  \
> -               : "r" (old),                    \
> -                 "r" (new));                   \
> -       } while(0)
> +#define        DRM_CAS(lock, old, new, ret)            \
> +       do {                                    \
> +               int tmp, old32;                 \
> +               __asm__ __volatile__(           \
> +               "       addl    $31, %5, %3\n"  \
> +               "1:     ldl_l   %0, %2\n"       \
> +               "       cmpeq   %0, %3, %1\n"   \
> +               "       beq     %1, 2f\n"       \
> +               "       mov     %4, %0\n"       \
> +               "       stl_c   %0, %2\n"       \
> +               "       beq     %0, 3f\n"       \
> +               "       mb\n"                   \
> +               "2:     cmpeq   %1, 0, %1\n"    \
> +               ".subsection 2\n"               \
> +               "3:     br      1b\n"           \
> +               ".previous"                     \
> +               : "=&r"(tmp), "=&r"(ret),       \
> +                 "=m"(__drm_dummy_lock(lock)), \
> +                 "=&r"(old32)                  \
> +               : "r"(new), "r"(old)            \
> +               : "memory");                    \
> +       } while (0)
>
>  #elif defined(__sparc__)
>
> @@ -429,7 +429,9 @@ do {        register unsigned int __old __asm("
>  #define DRM_CAS(lock,old,new,ret) do { ret=1; } while (0) /* FAST LOCK FAILS */
>  #endif
>
> -#if defined(__alpha__) || defined(__powerpc__)
> +#if defined(__alpha__)
> +#define DRM_CAS_RESULT(_result)                long _result
> +#elif defined(__powerpc__)
>  #define DRM_CAS_RESULT(_result)                int _result
>  #else
>  #define DRM_CAS_RESULT(_result)                char _result
>

After some stupidity on my part, this patch looks good and tests well for me.

It would be great to get others to test as well. To do so,

1) patch libdrm using this patch.
2) rebuild libdrm, and at least mesa-7.2, xorg-server-1.5.3
3) patch your kernel (-29_rc series preferably) with patch in
http://bugzilla.kernel.org/show_bug.cgi?id=10893
4) startx

Thanks Ivan!

Matt

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Need help fixing DRM locking on Alpha
  2009-02-12 22:15       ` Matt Turner
@ 2009-02-16 20:37         ` Michael Cree
  2009-02-16 22:19           ` Oliver Falk
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Cree @ 2009-02-16 20:37 UTC (permalink / raw)
  To: Matt Turner; +Cc: Ivan Kokshaysky, linux-alpha, klausman

On 13/02/2009, at 11:15 AM, Matt Turner wrote:
> It would be great to get others to test as well. To do so,
>
> 1) patch libdrm using this patch.
> 2) rebuild libdrm, and at least mesa-7.2, xorg-server-1.5.3
> 3) patch your kernel (-29_rc series preferably) with patch in
> http://bugzilla.kernel.org/show_bug.cgi?id=10893
> 4) startx

Done. Applied the kernel patch and the DRM patch and installed mesa  
7.3 and xserver 1.5.3.

Had the xserver up and going with gnome desktop on my ev67 alpha.   
Seems to be working fine.

Nice to see glxinfo return lots of info, and glxgears actually run  
without locking up.  But I only got 200 whatevers per second with  
glxgears.  I recall that it use to do 400.  Makes me wonder if I am  
really getting hardware acceleration.  This is with a Radeon 9200  
(RV280) graphics card.

Cheers
Michael.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Need help fixing DRM locking on Alpha
  2009-02-16 20:37         ` Michael Cree
@ 2009-02-16 22:19           ` Oliver Falk
  0 siblings, 0 replies; 12+ messages in thread
From: Oliver Falk @ 2009-02-16 22:19 UTC (permalink / raw)
  To: Michael Cree
  Cc: Matt Turner, Ivan Kokshaysky, linux-alpha, klausman,
	Jay Estabrook

Michael Cree schrieb:
> On 13/02/2009, at 11:15 AM, Matt Turner wrote:
>> It would be great to get others to test as well. To do so,
>>
>> 1) patch libdrm using this patch.
>> 2) rebuild libdrm, and at least mesa-7.2, xorg-server-1.5.3
>> 3) patch your kernel (-29_rc series preferably) with patch in
>> http://bugzilla.kernel.org/show_bug.cgi?id=10893
>> 4) startx
> 
> Done. Applied the kernel patch and the DRM patch and installed mesa 7.3 
> and xserver 1.5.3.
> 
> Had the xserver up and going with gnome desktop on my ev67 alpha.  Seems 
> to be working fine.
> 
> Nice to see glxinfo return lots of info, and glxgears actually run 
> without locking up.  But I only got 200 whatevers per second with 
> glxgears.  I recall that it use to do 400.  Makes me wonder if I am 
> really getting hardware acceleration.  This is with a Radeon 9200 
> (RV280) graphics card.

Well. At least the patch applied and the kernel came up:

[oliver@gosa ~]$ uname -a
Linux gosa.beer.linux-kernel.at 2.6.29-0.28.rc4.git6.1axp.fc10.alpha #1 
Sat Feb 14 08:07:29 CET 2009 alpha alpha alpha GNU/Linux

It's headless, so quite hard to say if drm locking is fixed or not, at 
the moment. But it's informative for Jay, that he can try this kernel 
:-) If he has time...

-of

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-02-16 22:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-09 21:43 Need help fixing DRM locking on Alpha Matt Turner
2009-02-10 15:43 ` Ivan Kokshaysky
2009-02-10 23:18   ` Matt Turner
2009-02-11 15:48     ` Ivan Kokshaysky
     [not found]       ` <b4198de60902111401x62c6eea0u8a0d02d12383ec@mail.gmail.com>
2009-02-11 22:13         ` Fwd: " Matt Turner
     [not found]         ` <b4198de60902111412o79479f6av7740552f5b0e9dc8@mail.gmail.com>
2009-02-11 22:13           ` Matt Turner
2009-02-12 22:15       ` Matt Turner
2009-02-16 20:37         ` Michael Cree
2009-02-16 22:19           ` Oliver Falk
2009-02-11 21:29     ` Michael Cree
2009-02-12  7:31       ` Oliver Falk
2009-02-12  7:43         ` Michael Cree

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).