linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Nouveau driver and Linux 2.6.33 RT
@ 2011-02-02 21:12 Miklos Aubert
  2011-02-03 20:18 ` Miklos Aubert
  2011-02-03 22:38 ` Paul Gortmaker
  0 siblings, 2 replies; 3+ messages in thread
From: Miklos Aubert @ 2011-02-02 21:12 UTC (permalink / raw)
  To: linux-rt-users

Hello fellow RT users,

I've built a 2.6.33.7 kernel with the RT patch and the Nouveau driver
enabled, but Xorg doesn't start.

Using the _same_ configuration and removing the RT patch (vanilla
kernel from kernel.org), Xorg works.

Booting with drm.debug=1, and comparing the kernel logs, I find that
the RT kernel seems to be having trouble here :

[   31.651720] [drm:drm_ioctl], pid=1904, cmd=0x6440, nr=0x40, dev
0xe200, auth=1
[   31.651724] [drm:drm_ioctl], no function
[   31.651726] [drm:drm_ioctl], ret = ffffffea

These messages come from the drm_ioctl() function in
drivers/gpu/drm/drm_drv.c. But which ioctl are we calling here ? I
guess one can find it from the cmd=0x6440 code. Not me though, I tried
to make sense of the source code, but my C is very rusty and it's
macros and includes all the way down...

Anyway, to me this problem seems to come from the modifications that
the RT patch does on drivers/gpu/drm/nouveau/nouveau_channel.c. It
changes the definition macro from DRM_IOCTL_DEF to DRM_IOCTL_DEF_DRV,
but also removes some lines. Why ?


 struct drm_ioctl_desc nouveau_ioctls[] = {
-   DRM_IOCTL_DEF(DRM_NOUVEAU_CARD_INIT, nouveau_ioctl_card_init, DRM_AUTH),
-   DRM_IOCTL_DEF(DRM_NOUVEAU_GETPARAM, nouveau_ioctl_getparam, DRM_AUTH),
-   DRM_IOCTL_DEF(DRM_NOUVEAU_SETPARAM, nouveau_ioctl_setparam,
DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-   DRM_IOCTL_DEF(DRM_NOUVEAU_CHANNEL_ALLOC, nouveau_ioctl_fifo_alloc,
DRM_AUTH),
-   DRM_IOCTL_DEF(DRM_NOUVEAU_CHANNEL_FREE, nouveau_ioctl_fifo_free, DRM_AUTH),
-   DRM_IOCTL_DEF(DRM_NOUVEAU_GROBJ_ALLOC, nouveau_ioctl_grobj_alloc, DRM_AUTH),
-   DRM_IOCTL_DEF(DRM_NOUVEAU_NOTIFIEROBJ_ALLOC,
nouveau_ioctl_notifier_alloc, DRM_AUTH),
-   DRM_IOCTL_DEF(DRM_NOUVEAU_GPUOBJ_FREE, nouveau_ioctl_gpuobj_free, DRM_AUTH),
-   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_NEW, nouveau_gem_ioctl_new, DRM_AUTH),
-   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_PUSHBUF, nouveau_gem_ioctl_pushbuf, DRM_AUTH),
-   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_PUSHBUF_CALL,
nouveau_gem_ioctl_pushbuf_call, DRM_AUTH),
-   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_PIN, nouveau_gem_ioctl_pin, DRM_AUTH),
-   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_UNPIN, nouveau_gem_ioctl_unpin, DRM_AUTH),
-   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_CPU_PREP,
nouveau_gem_ioctl_cpu_prep, DRM_AUTH),
-   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_CPU_FINI,
nouveau_gem_ioctl_cpu_fini, DRM_AUTH),
-   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_INFO, nouveau_gem_ioctl_info, DRM_AUTH),
-   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_PUSHBUF_CALL2,
nouveau_gem_ioctl_pushbuf_call2, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(NOUVEAU_GETPARAM, nouveau_ioctl_getparam, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(NOUVEAU_SETPARAM, nouveau_ioctl_setparam,
DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
+   DRM_IOCTL_DEF_DRV(NOUVEAU_CHANNEL_ALLOC, nouveau_ioctl_fifo_alloc,
DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(NOUVEAU_CHANNEL_FREE, nouveau_ioctl_fifo_free, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(NOUVEAU_GROBJ_ALLOC, nouveau_ioctl_grobj_alloc, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(NOUVEAU_NOTIFIEROBJ_ALLOC,
nouveau_ioctl_notifier_alloc, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(NOUVEAU_GPUOBJ_FREE, nouveau_ioctl_gpuobj_free, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(NOUVEAU_GEM_NEW, nouveau_gem_ioctl_new, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(NOUVEAU_GEM_PUSHBUF, nouveau_gem_ioctl_pushbuf, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(NOUVEAU_GEM_CPU_PREP,
nouveau_gem_ioctl_cpu_prep, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(NOUVEAU_GEM_CPU_FINI,
nouveau_gem_ioctl_cpu_fini, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(NOUVEAU_GEM_INFO, nouveau_gem_ioctl_info, DRM_AUTH),
 };
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: Nouveau driver and Linux 2.6.33 RT
  2011-02-02 21:12 Nouveau driver and Linux 2.6.33 RT Miklos Aubert
@ 2011-02-03 20:18 ` Miklos Aubert
  2011-02-03 22:38 ` Paul Gortmaker
  1 sibling, 0 replies; 3+ messages in thread
From: Miklos Aubert @ 2011-02-03 20:18 UTC (permalink / raw)
  To: linux-rt-users

On 2 February 2011 22:12, Miklos Aubert <miklos.aubert@gmail.com> wrote:
> Hello fellow RT users,
>
> I've built a 2.6.33.7 kernel with the RT patch and the Nouveau driver
> enabled, but Xorg doesn't start.
>
> Using the _same_ configuration and removing the RT patch (vanilla
> kernel from kernel.org), Xorg works.
>
> Booting with drm.debug=1, and comparing the kernel logs, I find that
> the RT kernel seems to be having trouble here :
>
> [   31.651720] [drm:drm_ioctl], pid=1904, cmd=0x6440, nr=0x40, dev
> 0xe200, auth=1
> [   31.651724] [drm:drm_ioctl], no function
> [   31.651726] [drm:drm_ioctl], ret = ffffffea

I finally got it to work! By trial and error, I found out that this
ioctl call is actually "NOUVEAU_CARD_INIT", which is defined in the
vanilla 2.6.33 kernel, but removed by the RT patch.

Not really understanding what I was doing, I tried putting this ioctl
back and came up with the patch included at the bottom of this mail.
Amazingly, it works!

I think the only reason I need this ioctl is because I'm running
Debian sid, and the current Xorg Nouveau driver wants it. When I try
linking libdrm_nouveau.so.1 to a version found in the libdrm_nouveau1a
package, the ioctl is not used, according to the dmesg. So the problem
should disappear in the next couple of updates. By then I hope a new
RT patch will be out with a newer kernel and Nouveau 0.0.16 :)


--- a/drivers/gpu/drm/nouveau/nouveau_channel.c	2011-02-03
20:17:10.000000000 +0100
+++ b/drivers/gpu/drm/nouveau/nouveau_channel.c	2011-02-03
17:07:47.000000000 +0100
@@ -408,6 +408,7 @@
  ***********************************/

 struct drm_ioctl_desc nouveau_ioctls[] = {
+	DRM_IOCTL_DEF_DRV(NOUVEAU_CARD_INIT, nouveau_ioctl_card_init, DRM_AUTH),
 	DRM_IOCTL_DEF_DRV(NOUVEAU_GETPARAM, nouveau_ioctl_getparam, DRM_AUTH),
 	DRM_IOCTL_DEF_DRV(NOUVEAU_SETPARAM, nouveau_ioctl_setparam,
DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
 	DRM_IOCTL_DEF_DRV(NOUVEAU_CHANNEL_ALLOC, nouveau_ioctl_fifo_alloc, DRM_AUTH),
--- a/include/drm/nouveau_drm.h	2011-02-03 20:17:49.000000000 +0100
+++ b/include/drm/nouveau_drm.h	2011-02-03 17:20:52.000000000 +0100
@@ -200,6 +200,10 @@
 struct drm_nouveau_sarea {
 };

+struct drm_nouveau_card_init {
+	uint32_t handle;
+};
+
 #define DRM_NOUVEAU_CARD_INIT          0x00
 #define DRM_NOUVEAU_GETPARAM           0x01
 #define DRM_NOUVEAU_SETPARAM           0x02
@@ -218,6 +222,7 @@
 #define DRM_NOUVEAU_GEM_INFO           0x47
 #define DRM_NOUVEAU_GEM_PUSHBUF_CALL2  0x48

+#define DRM_IOCTL_NOUVEAU_CARD_INIT
DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_CARD_INIT, struct
drm_nouveau_card_init)
 #define DRM_IOCTL_NOUVEAU_GETPARAM
DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GETPARAM, struct
drm_nouveau_getparam)
 #define DRM_IOCTL_NOUVEAU_SETPARAM
DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_SETPARAM, struct
drm_nouveau_setparam)
 #define DRM_IOCTL_NOUVEAU_CHANNEL_ALLOC
DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_CHANNEL_ALLOC, struct
drm_nouveau_channel_alloc)
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: Nouveau driver and Linux 2.6.33 RT
  2011-02-02 21:12 Nouveau driver and Linux 2.6.33 RT Miklos Aubert
  2011-02-03 20:18 ` Miklos Aubert
@ 2011-02-03 22:38 ` Paul Gortmaker
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Gortmaker @ 2011-02-03 22:38 UTC (permalink / raw)
  To: Miklos Aubert; +Cc: linux-rt-users

On Wed, Feb 2, 2011 at 4:12 PM, Miklos Aubert <miklos.aubert@gmail.com> wrote:
> Hello fellow RT users,
>
> I've built a 2.6.33.7 kernel with the RT patch and the Nouveau driver
> enabled, but Xorg doesn't start.
>
> Using the _same_ configuration and removing the RT patch (vanilla
> kernel from kernel.org), Xorg works.
>
> Booting with drm.debug=1, and comparing the kernel logs, I find that
> the RT kernel seems to be having trouble here :
>
> [   31.651720] [drm:drm_ioctl], pid=1904, cmd=0x6440, nr=0x40, dev
> 0xe200, auth=1
> [   31.651724] [drm:drm_ioctl], no function
> [   31.651726] [drm:drm_ioctl], ret = ffffffea
>
> These messages come from the drm_ioctl() function in
> drivers/gpu/drm/drm_drv.c. But which ioctl are we calling here ? I
> guess one can find it from the cmd=0x6440 code. Not me though, I tried
> to make sense of the source code, but my C is very rusty and it's
> macros and includes all the way down...
>
> Anyway, to me this problem seems to come from the modifications that
> the RT patch does on drivers/gpu/drm/nouveau/nouveau_channel.c. It
> changes the definition macro from DRM_IOCTL_DEF to DRM_IOCTL_DEF_DRV,
> but also removes some lines. Why ?

The removals you point at are due to the different baseline of 33.7 vs. whatever
you are comparing it to.  They dont come from RT, as you can see below:

-------------------------
patches$grep -l nouveau *
printk-convert-console_sem-to-console_mutex.patch
patches$diffstat -p0
printk-convert-console_sem-to-console_mutex.patch|grep nouveau
 b/drivers/gpu/drm/nouveau/nouveau_drv.c  |    8 +-
patches$grep DRM_IOCTL_DEF printk-convert-console_sem-to-console_mutex.patch
patches$
-------------------------

You can verify the above yourself by cloning:

git://git.kernel.org/pub/scm/linux/kernel/git/paulg/rt-patches.git

and checking out origin/v2.6.33-rt (which is content identical to 33.7-rt30).

Paul

>
>
>  struct drm_ioctl_desc nouveau_ioctls[] = {
> -   DRM_IOCTL_DEF(DRM_NOUVEAU_CARD_INIT, nouveau_ioctl_card_init, DRM_AUTH),
> -   DRM_IOCTL_DEF(DRM_NOUVEAU_GETPARAM, nouveau_ioctl_getparam, DRM_AUTH),
> -   DRM_IOCTL_DEF(DRM_NOUVEAU_SETPARAM, nouveau_ioctl_setparam,
> DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
> -   DRM_IOCTL_DEF(DRM_NOUVEAU_CHANNEL_ALLOC, nouveau_ioctl_fifo_alloc,
> DRM_AUTH),
> -   DRM_IOCTL_DEF(DRM_NOUVEAU_CHANNEL_FREE, nouveau_ioctl_fifo_free, DRM_AUTH),
> -   DRM_IOCTL_DEF(DRM_NOUVEAU_GROBJ_ALLOC, nouveau_ioctl_grobj_alloc, DRM_AUTH),
> -   DRM_IOCTL_DEF(DRM_NOUVEAU_NOTIFIEROBJ_ALLOC,
> nouveau_ioctl_notifier_alloc, DRM_AUTH),
> -   DRM_IOCTL_DEF(DRM_NOUVEAU_GPUOBJ_FREE, nouveau_ioctl_gpuobj_free, DRM_AUTH),
> -   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_NEW, nouveau_gem_ioctl_new, DRM_AUTH),
> -   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_PUSHBUF, nouveau_gem_ioctl_pushbuf, DRM_AUTH),
> -   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_PUSHBUF_CALL,
> nouveau_gem_ioctl_pushbuf_call, DRM_AUTH),
> -   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_PIN, nouveau_gem_ioctl_pin, DRM_AUTH),
> -   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_UNPIN, nouveau_gem_ioctl_unpin, DRM_AUTH),
> -   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_CPU_PREP,
> nouveau_gem_ioctl_cpu_prep, DRM_AUTH),
> -   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_CPU_FINI,
> nouveau_gem_ioctl_cpu_fini, DRM_AUTH),
> -   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_INFO, nouveau_gem_ioctl_info, DRM_AUTH),
> -   DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_PUSHBUF_CALL2,
> nouveau_gem_ioctl_pushbuf_call2, DRM_AUTH),
> +   DRM_IOCTL_DEF_DRV(NOUVEAU_GETPARAM, nouveau_ioctl_getparam, DRM_AUTH),
> +   DRM_IOCTL_DEF_DRV(NOUVEAU_SETPARAM, nouveau_ioctl_setparam,
> DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
> +   DRM_IOCTL_DEF_DRV(NOUVEAU_CHANNEL_ALLOC, nouveau_ioctl_fifo_alloc,
> DRM_AUTH),
> +   DRM_IOCTL_DEF_DRV(NOUVEAU_CHANNEL_FREE, nouveau_ioctl_fifo_free, DRM_AUTH),
> +   DRM_IOCTL_DEF_DRV(NOUVEAU_GROBJ_ALLOC, nouveau_ioctl_grobj_alloc, DRM_AUTH),
> +   DRM_IOCTL_DEF_DRV(NOUVEAU_NOTIFIEROBJ_ALLOC,
> nouveau_ioctl_notifier_alloc, DRM_AUTH),
> +   DRM_IOCTL_DEF_DRV(NOUVEAU_GPUOBJ_FREE, nouveau_ioctl_gpuobj_free, DRM_AUTH),
> +   DRM_IOCTL_DEF_DRV(NOUVEAU_GEM_NEW, nouveau_gem_ioctl_new, DRM_AUTH),
> +   DRM_IOCTL_DEF_DRV(NOUVEAU_GEM_PUSHBUF, nouveau_gem_ioctl_pushbuf, DRM_AUTH),
> +   DRM_IOCTL_DEF_DRV(NOUVEAU_GEM_CPU_PREP,
> nouveau_gem_ioctl_cpu_prep, DRM_AUTH),
> +   DRM_IOCTL_DEF_DRV(NOUVEAU_GEM_CPU_FINI,
> nouveau_gem_ioctl_cpu_fini, DRM_AUTH),
> +   DRM_IOCTL_DEF_DRV(NOUVEAU_GEM_INFO, nouveau_gem_ioctl_info, DRM_AUTH),
>  };
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2011-02-03 22:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-02 21:12 Nouveau driver and Linux 2.6.33 RT Miklos Aubert
2011-02-03 20:18 ` Miklos Aubert
2011-02-03 22:38 ` Paul Gortmaker

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).