Bug#732514: [PATCH] fixes for Radeon KMS on kFreeBSD

2013-12-25 Thread Robert Millan
On 25/12/2013 02:07, Cyril Brulebois wrote:
 -Suggests: firmware-linux
 +Suggests: firmware-linux [linux-any], kfreebsd-downloader ( 11~) 
 [kfreebsd-any] | kfreebsd-downloader-10 [kfreebsd-any]
 
 foo ( bar) is antique dpkg syntax.

I meant to say strictly greater (), though in this case it doesn't really 
matter.

 and:
 | kibi@arya:~$ rmadison kfreebsd-downloader
 | kfreebsd-downloader | 9.0-3+deb70.1 |   stable/contrib | source, 
 kfreebsd-amd64, kfreebsd-i386
 | kfreebsd-downloader | 9.2-1 |  testing/contrib | source, 
 kfreebsd-amd64, kfreebsd-i386
 | kfreebsd-downloader | 9.2-1 | unstable/contrib | source, 
 kfreebsd-amd64, kfreebsd-i386

Yes. The first branch of the expression is for forward-compatibility.

-- 
Robert Millan


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/52babb81.90...@debian.org



Bug#732514: [PATCH] fixes for Radeon KMS on kFreeBSD

2013-12-24 Thread Robert Millan

Upstream part is merged in their repository now. I'm attaching an update for the
Debian part (regarding kfreebsd-downloader).

-- 
Robert Millan
diff -ur xserver-xorg-video-ati-7.2.0/debian/control xserver-xorg-video-ati-7.2.0.new/debian/control
--- xserver-xorg-video-ati-7.2.0/debian/control	2013-12-16 22:40:22.0 +0100
+++ xserver-xorg-video-ati-7.2.0.new/debian/control	2013-12-16 22:54:49.294891823 +0100
@@ -79,7 +79,7 @@
  ${misc:Depends},
  ${xviddriver:Depends}
 Provides: ${xviddriver:Provides}
-Suggests: firmware-linux
+Suggests: firmware-linux [linux-any], kfreebsd-downloader ( 11~) [kfreebsd-any] | kfreebsd-downloader-10 [kfreebsd-any]
 Description: X.Org X server -- AMD/ATI Radeon display driver
  This package provides the 'radeon' driver for the AMD/ATI cards. The
  following chips should be supported: R100, RV100, RS100, RV200, RS200,


Bug#732514: [PATCH] fixes for Radeon KMS on kFreeBSD

2013-12-24 Thread Cyril Brulebois
Robert Millan r...@debian.org (2013-12-24):
 Upstream part is merged in their repository now. I'm attaching an update for 
 the
 Debian part (regarding kfreebsd-downloader).
 
 -- 
 Robert Millan

 diff -ur xserver-xorg-video-ati-7.2.0/debian/control 
 xserver-xorg-video-ati-7.2.0.new/debian/control
 --- xserver-xorg-video-ati-7.2.0/debian/control   2013-12-16 
 22:40:22.0 +0100
 +++ xserver-xorg-video-ati-7.2.0.new/debian/control   2013-12-16 
 22:54:49.294891823 +0100
 @@ -79,7 +79,7 @@
   ${misc:Depends},
   ${xviddriver:Depends}
  Provides: ${xviddriver:Provides}
 -Suggests: firmware-linux
 +Suggests: firmware-linux [linux-any], kfreebsd-downloader ( 11~) 
 [kfreebsd-any] | kfreebsd-downloader-10 [kfreebsd-any]

foo ( bar) is antique dpkg syntax.

and:
| kibi@arya:~$ rmadison kfreebsd-downloader
| kfreebsd-downloader | 9.0-3+deb70.1 |   stable/contrib | source, 
kfreebsd-amd64, kfreebsd-i386
| kfreebsd-downloader | 9.2-1 |  testing/contrib | source, 
kfreebsd-amd64, kfreebsd-i386
| kfreebsd-downloader | 9.2-1 | unstable/contrib | source, 
kfreebsd-amd64, kfreebsd-i386

Mraw,
KiBi.


signature.asc
Description: Digital signature


Bug#732514: [PATCH] fixes for Radeon KMS on kFreeBSD

2013-12-18 Thread Robert Millan
Package: xserver-xorg-video-ati
Version: 7.2.0-1
Tags: patch
User: debian-...@lists.debian.org
Usertags: kfreebsd

Hi,

Please consider this set of fixes for KMS support on kFreeBSD:

- Load radeonkms module instead of radeon.

- Replace linux-firmware with kfreebsd-downloader (non-free firmware).

Thanks

-- 
Robert Millan

diff -ur xserver-xorg-video-ati-7.2.0/debian/control xserver-xorg-video-ati-7.2.0.new/debian/control
--- xserver-xorg-video-ati-7.2.0/debian/control	2013-12-16 22:40:22.0 +0100
+++ xserver-xorg-video-ati-7.2.0.new/debian/control	2013-12-16 22:54:49.294891823 +0100
@@ -79,7 +79,7 @@
  ${misc:Depends},
  ${xviddriver:Depends}
 Provides: ${xviddriver:Provides}
-Suggests: firmware-linux
+Suggests: firmware-linux [linux-any], kfreebsd-downloader (= 10) [kfreebsd-any] | kfreebsd-downloader-10 [kfreebsd-any]
 Description: X.Org X server -- AMD/ATI Radeon display driver
  This package provides the 'radeon' driver for the AMD/ATI cards. The
  following chips should be supported: R100, RV100, RS100, RV200, RS200,
diff -ur xserver-xorg-video-ati-7.2.0/src/radeon_kms.c xserver-xorg-video-ati-7.2.0.new/src/radeon_kms.c
--- xserver-xorg-video-ati-7.2.0/src/radeon_kms.c	2013-08-07 10:44:09.0 +0200
+++ xserver-xorg-video-ati-7.2.0.new/src/radeon_kms.c	2013-12-16 23:09:20.300888549 +0100
@@ -606,7 +606,13 @@
 		  dev-domain, dev-bus, dev-dev, dev-func);
 #endif
 
-info-dri2.drm_fd = drmOpen(radeon, busid);
+info-dri2.drm_fd = drmOpen(
+#ifdef __FreeBSD_kernel__
+radeonkms,
+#else
+radeon,
+#endif
+busid);
 if (info-dri2.drm_fd == -1) {
 
 	xf86DrvMsg(pScrn-scrnIndex, X_ERROR,



Bug#732514: [PATCH] fixes for Radeon KMS on kFreeBSD

2013-12-18 Thread Robert Millan
reassign 732514 xserver-xorg-video-radeon
thanks

On 18/12/2013 13:31, Robert Millan wrote:
 Package: xserver-xorg-video-ati
 Version: 7.2.0-1
 Tags: patch
 User: debian-...@lists.debian.org
 Usertags: kfreebsd
 
 Hi,
 
 Please consider this set of fixes for KMS support on kFreeBSD:
 
 - Load radeonkms module instead of radeon.

Actually, this was done at the wrong place. The first argument to
drmOpen() call is a red herring. It's supposed to load a kernel module,
but unless the module is already loaded this code is never reached
because drmCheckModesettingSupported() failure is treated as an
abort condition.

Please use this patch instead. This makes it load the module when
drmCheckModesettingSupported() fails, and then try the check again.

This is inspired by similar approach in intel driver (see
src/intel_device.c).

I'll submit it upstream as well.

-- 
Robert Millan
diff -ur xserver-xorg-video-ati-7.2.0/debian/control xserver-xorg-video-ati-7.2.0.new/debian/control
--- xserver-xorg-video-ati-7.2.0/debian/control	2013-12-16 22:40:22.0 +0100
+++ xserver-xorg-video-ati-7.2.0.new/debian/control	2013-12-16 22:54:49.294891823 +0100
@@ -79,7 +79,7 @@
  ${misc:Depends},
  ${xviddriver:Depends}
 Provides: ${xviddriver:Provides}
-Suggests: firmware-linux
+Suggests: firmware-linux [linux-any], kfreebsd-downloader (= 10) [kfreebsd-any]
 Description: X.Org X server -- AMD/ATI Radeon display driver
  This package provides the 'radeon' driver for the AMD/ATI cards. The
  following chips should be supported: R100, RV100, RS100, RV200, RS200,
diff -ur xserver-xorg-video-ati-7.2.0/src/radeon_probe.c xserver-xorg-video-ati-7.2.0.new/src/radeon_probe.c
--- xserver-xorg-video-ati-7.2.0/src/radeon_probe.c	2013-08-07 10:44:09.0 +0200
+++ xserver-xorg-video-ati-7.2.0.new/src/radeon_probe.c	2013-12-18 20:56:19.525329978 +0100
@@ -46,6 +46,7 @@
 #include atipcirename.h
 
 #include xf86.h
+#include xf86_OSproc.h
 
 #include xf86drmMode.h
 #include dri.h
@@ -92,6 +93,16 @@
 
 busIdString = DRICreatePCIBusID(pci_dev);
 ret = drmCheckModesettingSupported(busIdString);
+if (ret) {
+  if (xf86LoadKernelModule(
+#ifdef __FreeBSD_kernel__
+			   radeonkms
+#else
+			   radeon
+#endif
+			   ))
+ret = drmCheckModesettingSupported(busIdString);
+}
 free(busIdString);
 if (ret) {
   xf86DrvMsgVerb(pScrn-scrnIndex, X_INFO, 0,


Bug#732514: [PATCH] fixes for Radeon KMS on kFreeBSD

2013-12-18 Thread Julien Cristau
On Wed, Dec 18, 2013 at 21:40:21 +0100, Robert Millan wrote:

  - Load radeonkms module instead of radeon.
 
 Actually, this was done at the wrong place. The first argument to
 drmOpen() call is a red herring. It's supposed to load a kernel module,
 but unless the module is already loaded this code is never reached
 because drmCheckModesettingSupported() failure is treated as an
 abort condition.
 
 Please use this patch instead. This makes it load the module when
 drmCheckModesettingSupported() fails, and then try the check again.
 
Does the freebsd kernel not autoload the driver?  (Why not?)

Cheers,
Julien


signature.asc
Description: Digital signature


Bug#732514: [PATCH] fixes for Radeon KMS on kFreeBSD

2013-12-18 Thread Robert Millan
On 18/12/2013 21:52, Julien Cristau wrote:
 Does the freebsd kernel not autoload the driver?

No.

 (Why not?)

Upstream doesn't provide a devd kldload ruleset for PCI devices, like they
do for USB. IIRC, this is because usage of PCI support internal interaces
in the driver codebase is less uniform than that of USB. For USB, they
extract the USB ids using a parser, but currently they can't do the same
thing for PCI (and they don't want to do this manually).

It wouldn't be terribly difficult to fix this, but it's a boring task and
so far nobody volunteered. If someone reading this is interested, please
let me know ;-)

Besides, when it comes to KMS drivers, is there a point in auto-loading them
just because the hardware is present? AFAICS it makes a lot more sense to load
them only when X is started and we know we will need them.

-- 
Robert Millan


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/52b20e17.4070...@debian.org



Bug#732514: [PATCH] fixes for Radeon KMS on kFreeBSD

2013-12-18 Thread Julien Cristau
On Wed, Dec 18, 2013 at 22:05:27 +0100, Robert Millan wrote:

 Besides, when it comes to KMS drivers, is there a point in auto-loading them
 just because the hardware is present? AFAICS it makes a lot more sense to load
 them only when X is started and we know we will need them.
 
Yes.  At least on linux it also gives you the fb console.  And there's
been a number of bug reports where X failed to start because the radeon
kernel driver was loaded too late.

Cheers,
Julien


signature.asc
Description: Digital signature


Bug#732514: [PATCH] fixes for Radeon KMS on kFreeBSD

2013-12-18 Thread Robert Millan
On 18/12/2013 22:09, Julien Cristau wrote:
 On Wed, Dec 18, 2013 at 22:05:27 +0100, Robert Millan wrote:
 
 Besides, when it comes to KMS drivers, is there a point in auto-loading them
 just because the hardware is present? AFAICS it makes a lot more sense to 
 load
 them only when X is started and we know we will need them.

 Yes.  At least on linux it also gives you the fb console.

Oh. Well we don't enable that yet (but now that you mention it, maybe we
should...).

 And there's
 been a number of bug reports where X failed to start because the radeon
 kernel driver was loaded too late.

Where's this race condition? Is it related to the Linux plumbing, or something
that could affect us too?

-- 
Robert Millan


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/52b2111f.60...@debian.org



Bug#732514: [PATCH] fixes for Radeon KMS on kFreeBSD

2013-12-18 Thread Alex Deucher
On Wed, Dec 18, 2013 at 4:09 PM, Julien Cristau jcris...@debian.org wrote:
 On Wed, Dec 18, 2013 at 22:05:27 +0100, Robert Millan wrote:

 Besides, when it comes to KMS drivers, is there a point in auto-loading them
 just because the hardware is present? AFAICS it makes a lot more sense to 
 load
 them only when X is started and we know we will need them.

 Yes.  At least on linux it also gives you the fb console.  And there's
 been a number of bug reports where X failed to start because the radeon
 kernel driver was loaded too late.

You also may want to use the driver without X, e.g., wayland, or
headless compute.  Additionally, if you have the driver loaded you can
use advanced power management features and dpms which are not
available with vesa or vga mode.

Alex


 Cheers,
 Julien

 ___
 xorg-driver-ati mailing list
 xorg-driver-...@lists.x.org
 http://lists.x.org/mailman/listinfo/xorg-driver-ati



-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/CADnq5_MBA5rn7NN94nQMmVMdb4iS0PnPS=-35una2u-fpdv...@mail.gmail.com



Bug#732514: [PATCH] fixes for Radeon KMS on kFreeBSD

2013-12-18 Thread Alex Deucher
On Wed, Dec 18, 2013 at 4:18 PM, Robert Millan r...@debian.org wrote:
 On 18/12/2013 22:09, Julien Cristau wrote:
 On Wed, Dec 18, 2013 at 22:05:27 +0100, Robert Millan wrote:

 Besides, when it comes to KMS drivers, is there a point in auto-loading them
 just because the hardware is present? AFAICS it makes a lot more sense to 
 load
 them only when X is started and we know we will need them.

 Yes.  At least on linux it also gives you the fb console.

 Oh. Well we don't enable that yet (but now that you mention it, maybe we
 should...).

 And there's
 been a number of bug reports where X failed to start because the radeon
 kernel driver was loaded too late.

 Where's this race condition? Is it related to the Linux plumbing, or something
 that could affect us too?

It could affect you too.  With UMS, the ddx would load the kernel
driver, but the kernel driver didn't actually do anything until the
ddx explicitly asked it to something.  With UMS, the ddx still took
care of hw init, the kernel driver basically just managed dma
addresses.  With KMS, the kernel driver inits and manages the hw so it
takes relatively longer to load and the ddx may try and access the
kernel driver before it's finished loading leading to fail.

Alex


 --
 Robert Millan

 ___
 xorg-driver-ati mailing list
 xorg-driver-...@lists.x.org
 http://lists.x.org/mailman/listinfo/xorg-driver-ati


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/cadnq5_mbheazvam68k5up2gj70_zgfv5rxa9znd63r6+xmb...@mail.gmail.com