Re: Q: 'MacModel' replacement for radeon driver?
On Mit, 2013-02-13 at 21:07 +0100, Albrecht Dreß wrote: Am 13.02.13 19:01 schrieb(en) Alex Deucher: On Wed, Feb 13, 2013 at 12:59 PM, Daniel Vetter dan...@ffwll.ch wrote: On Thu, Jan 31, 2013 at 4:50 PM, Alex Deucher alexdeuc...@gmail.com wrote: You could try and bisect if KMS used to work at some point in the past. I've recently seen reports from others of r1xx cards working ok at least on x86. I have an rv270 on an mac mini here and that thing used to work with kms. Been a while though since I've last fired it up ... So going back and trying to bisect could be really useful. If you could that would be great. The intermediate status: I installed Debian Squeeze on an extra disk, and there the radeon driver works when I add the 'Option MacModel mini-internal' to xorg.conf. Not a big surprise, as Linux 2.6.32 is rather old. I also included 'radeon.modeset=1' in the Kernel command line. dmesg says '[drm] radeon kernel modesetting enabled', but Xorg.0.log warns '[KMS] drm report modesetting isn't supported.'. That means the X driver is running in UMS mode and programming the hardware directly behind the kernel driver's back, so this is not a valid test for KMS working. Make sure the radeon kernel module is loaded before X starts. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Debian, X and DRI developer ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: Q: 'MacModel' replacement for radeon driver?
On Thu, Jan 31, 2013 at 4:50 PM, Alex Deucher alexdeuc...@gmail.com wrote: You could try and bisect if KMS used to work at some point in the past. I've recently seen reports from others of r1xx cards working ok at least on x86. I have an rv270 on an mac mini here and that thing used to work with kms. Been a while though since I've last fired it up ... So going back and trying to bisect could be really useful. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: Q: 'MacModel' replacement for radeon driver?
On Wed, Feb 13, 2013 at 12:59 PM, Daniel Vetter dan...@ffwll.ch wrote: On Thu, Jan 31, 2013 at 4:50 PM, Alex Deucher alexdeuc...@gmail.com wrote: You could try and bisect if KMS used to work at some point in the past. I've recently seen reports from others of r1xx cards working ok at least on x86. I have an rv270 on an mac mini here and that thing used to work with kms. Been a while though since I've last fired it up ... So going back and trying to bisect could be really useful. If you could that would be great. Alex ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: Q: 'MacModel' replacement for radeon driver?
Am 13.02.13 19:01 schrieb(en) Alex Deucher: On Wed, Feb 13, 2013 at 12:59 PM, Daniel Vetter dan...@ffwll.ch wrote: On Thu, Jan 31, 2013 at 4:50 PM, Alex Deucher alexdeuc...@gmail.com wrote: You could try and bisect if KMS used to work at some point in the past. I've recently seen reports from others of r1xx cards working ok at least on x86. I have an rv270 on an mac mini here and that thing used to work with kms. Been a while though since I've last fired it up ... So going back and trying to bisect could be really useful. If you could that would be great. The intermediate status: I installed Debian Squeeze on an extra disk, and there the radeon driver works when I add the 'Option MacModel mini-internal' to xorg.conf. Not a big surprise, as Linux 2.6.32 is rather old. I also included 'radeon.modeset=1' in the Kernel command line. dmesg says '[drm] radeon kernel modesetting enabled', but Xorg.0.log warns '[KMS] drm report modesetting isn't supported.'. Hmmm Without an xorg.conf file (i.e. w/o the mini-internal option), I see the same shades etc. I reported for Ubuntu 12.10 with the 3.7 kernel. I will try the next available kernel versions (2.6.34, 3.0, ...) so I can narrow down the point where it fails (hope this is the right approach?). Unfortunately, building the kernel takes ages... Best, Albrecht. pgpi7KE0xPdGk.pgp Description: PGP signature ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: Q: 'MacModel' replacement for radeon driver?
On Wed, Jan 30, 2013 at 1:18 PM, Albrecht Dreß albrecht.dr...@arcor.de wrote: Am 28.01.13 16:48 schrieb(en) Alex Deucher: We've checked all the relevant registers, dumping regs from OS X won't help. Perhaps the KMS driver is trying to point the display at an invalid MC address or something like that. Others have reported r1xx/r2xx radeons working ok with KMS so it may be something mac or ppc specific. IOW, you don't see a realistic chance to get it working (again) on my box? I.e. my only chance for accelerated graphics would be re-installing an old(er) Ubuntu (or Squeeze might work, too, as everything is a little older there)? You could try and bisect if KMS used to work at some point in the past. I've recently seen reports from others of r1xx cards working ok at least on x86. Alex ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: Q: 'MacModel' replacement for radeon driver?
Am 28.01.13 16:48 schrieb(en) Alex Deucher: We've checked all the relevant registers, dumping regs from OS X won't help. Perhaps the KMS driver is trying to point the display at an invalid MC address or something like that. Others have reported r1xx/r2xx radeons working ok with KMS so it may be something mac or ppc specific. IOW, you don't see a realistic chance to get it working (again) on my box? I.e. my only chance for accelerated graphics would be re-installing an old(er) Ubuntu (or Squeeze might work, too, as everything is a little older there)? Thanks, Albrecht. pgpU5eInnjDcY.pgp Description: PGP signature ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: Q: 'MacModel' replacement for radeon driver?
On Son, 2013-01-27 at 12:38 +0100, Albrecht Dreß wrote: I played a little more with the regs, but unfortunately could not find a solution. I.e. I still don't have a usable signal on the connector. Maybe it would be helpful to check the radeon register settings from Mac OS 10.4. What do you think? Unfortunately, the radeonreg tool doesn't compile on OS X out of the box, and using some hacks I found on the internet, it doesn't produce any usable output. Probably I have to dig into Apple's iokit for that. Or do you know about a tool which would enlighten the situation? Ben, any pointers for this? -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Debian, X and DRI developer ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: Q: 'MacModel' replacement for radeon driver?
On Sun, Jan 27, 2013 at 6:38 AM, Albrecht Dreß albrecht.dr...@arcor.de wrote: Hi Alex: I played a little more with the regs, but unfortunately could not find a solution. I.e. I still don't have a usable signal on the connector. Maybe it would be helpful to check the radeon register settings from Mac OS 10.4. What do you think? Unfortunately, the radeonreg tool doesn't compile on OS X out of the box, and using some hacks I found on the internet, it doesn't produce any usable output. Probably I have to dig into Apple's iokit for that. Or do you know about a tool which would enlighten the situation? We've checked all the relevant registers, dumping regs from OS X won't help. Perhaps the KMS driver is trying to point the display at an invalid MC address or something like that. Others have reported r1xx/r2xx radeons working ok with KMS so it may be something mac or ppc specific. Alex Thanks, Albrecht. Am 05.01.13 12:31 schrieb(en) Albrecht Dreß: Hi Alex: Am 03.01.13 20:36 schrieb(en) Alex Deucher: hmmm... everything else looks pretty good. Try the attached patch. This doesn't change the situation. Maybe the pll isn't quite right. You might try diffing the 2 reg dumps you sent me originally and using them as a guide to identify which registers are problematic. Boot up to the broken state and then use radeonreg to set the registers to the values from the working dump. e.g., radeonreg regset 0x0250 0x009f0013 Some of the registers are related the memory configuration of each driver so try the following registers: 0050 03000600 0054 8048 0058 ff002102 0204 008c051b 0250 009f0013 0254 03ff0026 0278 009f03ff 027c 0030 0284 000300cd 02c4 008c001e 02c8 00860004 02f0 20007c7c 03f8 02000200 088c 07880100 0d04 0806 I set all these regs, one by one, to the values from the working fbdev configuration of kernel 3.6.5, and double-checked with 'radeonreg regs radeon' that they actually have these values. However, the situation doesn't change, i.e. these is still no output on the connector. Thanks, Albrecht. ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: Q: 'MacModel' replacement for radeon driver?
Hi Alex: I played a little more with the regs, but unfortunately could not find a solution. I.e. I still don't have a usable signal on the connector. Maybe it would be helpful to check the radeon register settings from Mac OS 10.4. What do you think? Unfortunately, the radeonreg tool doesn't compile on OS X out of the box, and using some hacks I found on the internet, it doesn't produce any usable output. Probably I have to dig into Apple's iokit for that. Or do you know about a tool which would enlighten the situation? Thanks, Albrecht. Am 05.01.13 12:31 schrieb(en) Albrecht Dreß: Hi Alex: Am 03.01.13 20:36 schrieb(en) Alex Deucher: hmmm... everything else looks pretty good. Try the attached patch. This doesn't change the situation. Maybe the pll isn't quite right. You might try diffing the 2 reg dumps you sent me originally and using them as a guide to identify which registers are problematic. Boot up to the broken state and then use radeonreg to set the registers to the values from the working dump. e.g., radeonreg regset 0x0250 0x009f0013 Some of the registers are related the memory configuration of each driver so try the following registers: 0050 03000600 0054 8048 0058 ff002102 0204 008c051b 0250 009f0013 0254 03ff0026 0278 009f03ff 027c 0030 0284 000300cd 02c4 008c001e 02c8 00860004 02f0 20007c7c 03f8 02000200 088c 07880100 0d04 0806 I set all these regs, one by one, to the values from the working fbdev configuration of kernel 3.6.5, and double-checked with 'radeonreg regs radeon' that they actually have these values. However, the situation doesn't change, i.e. these is still no output on the connector. Thanks, Albrecht. pgpzNtC6GnOeW.pgp Description: PGP signature ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: Q: 'MacModel' replacement for radeon driver?
Hi Alex: Am 03.01.13 20:36 schrieb(en) Alex Deucher: hmmm... everything else looks pretty good. Try the attached patch. This doesn't change the situation. Maybe the pll isn't quite right. You might try diffing the 2 reg dumps you sent me originally and using them as a guide to identify which registers are problematic. Boot up to the broken state and then use radeonreg to set the registers to the values from the working dump. e.g., radeonreg regset 0x0250 0x009f0013 Some of the registers are related the memory configuration of each driver so try the following registers: 0050 03000600 0054 8048 0058 ff002102 0204 008c051b 0250 009f0013 0254 03ff0026 0278 009f03ff 027c 0030 0284 000300cd 02c4 008c001e 02c8 00860004 02f0 20007c7c 03f8 02000200 088c 07880100 0d04 0806 I set all these regs, one by one, to the values from the working fbdev configuration of kernel 3.6.5, and double-checked with 'radeonreg regs radeon' that they actually have these values. However, the situation doesn't change, i.e. these is still no output on the connector. Thanks, Albrecht. pgpU2kRmYdnpD.pgp Description: PGP signature ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: Q: 'MacModel' replacement for radeon driver?
Hi Alex: I wish you a very happy new year 2013,. and a again thanks a lot for your help! Am 03.01.13 02:30 schrieb(en) Alex Deucher: Does the attached patch help? Unfortunately not - again, the first boot screen is visible, then the display flickers, and the shades/lines/pixels appear during the text mode boot process. Then X launches, and again the shades/lines/pixels appear. Logs and regs dump attached. Thanks, Albrecht. new-patch-logs.tar.bz2 Description: application/bzip-compressed-tar pgpOJQHAfrvAy.pgp Description: PGP signature ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: Q: 'MacModel' replacement for radeon driver?
On Thu, Jan 3, 2013 at 12:45 PM, Albrecht Dreß albrecht.dr...@arcor.de wrote: Hi Alex: I wish you a very happy new year 2013,. and a again thanks a lot for your help! Am 03.01.13 02:30 schrieb(en) Alex Deucher: Does the attached patch help? Unfortunately not - again, the first boot screen is visible, then the display flickers, and the shades/lines/pixels appear during the text mode boot process. Then X launches, and again the shades/lines/pixels appear. Logs and regs dump attached. hmmm... everything else looks pretty good. Try the attached patch. Maybe the pll isn't quite right. You might try diffing the 2 reg dumps you sent me originally and using them as a guide to identify which registers are problematic. Boot up to the broken state and then use radeonreg to set the registers to the values from the working dump. e.g., radeonreg regset 0x0250 0x009f0013 Some of the registers are related the memory configuration of each driver so try the following registers: 0050 03000600 0054 8048 0058 ff002102 0204 008c051b 0250 009f0013 0254 03ff0026 0278 009f03ff 027c 0030 0284 000300cd 02c4 008c001e 02c8 00860004 02f0 20007c7c 03f8 02000200 088c 07880100 0d04 0806 Alex Thanks, Albrecht. pll_hack.diff Description: Binary data ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: Q: 'MacModel' replacement for radeon driver?
On Fri, Dec 21, 2012 at 3:22 PM, Albrecht Dreß albrecht.dr...@arcor.de wrote: Hi Alex! Am 21.12.12 19:44 schrieb(en) Alex Deucher: Sounds like internal tmds may be broken in kms. Probably easiest to dump the registers from a working setup (console fb, or old version of the driver) and a non-working setup (driver with the attached patch applied). Then send me the output. See attached: working Xorg w/ kernel 3.6.5 and fbdev, broken w/ kernel 3.7.1 and radeon driver. Does the attached patch help? Alex From 4e8bd671c5e17a7cf8b64c151651866780da573f Mon Sep 17 00:00:00 2001 From: Alex Deucher alexander.deuc...@amd.com Date: Wed, 2 Jan 2013 20:29:00 -0500 Subject: [PATCH] drm/radeon: fix DFP setup on pre-avivo asics Signed-off-by: Alex Deucher alexander.deuc...@amd.com --- drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 60 +++--- 1 files changed, 16 insertions(+), 44 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c index 6857cb4..4c83d3d 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c @@ -53,7 +53,6 @@ static void radeon_legacy_rmx_mode_set(struct drm_crtc *crtc, bool hscale = true, vscale = true; int hsync_wid; int vsync_wid; - int hsync_start; int blank_width; u32 scale, inc, crtc_more_cntl; u32 fp_horz_stretch, fp_vert_stretch, fp_horz_vert_active; @@ -68,7 +67,8 @@ static void radeon_legacy_rmx_mode_set(struct drm_crtc *crtc, (RADEON_HORZ_FP_LOOP_STRETCH | RADEON_HORZ_AUTO_RATIO_INC); - crtc_more_cntl = 0; + crtc_more_cntl = (RADEON_CRTC_H_CUTOFF_ACTIVE_EN | + RADEON_CRTC_V_CUTOFF_ACTIVE_EN); if ((rdev-family == CHIP_RS100) || (rdev-family == CHIP_RS200)) { /* This is to workaround the asic bug for RMX, some versions @@ -76,35 +76,37 @@ static void radeon_legacy_rmx_mode_set(struct drm_crtc *crtc, crtc_more_cntl |= RADEON_CRTC_H_CUTOFF_ACTIVE_EN; } + blank_width = (mode-crtc_hblank_end - mode-crtc_hblank_start) / 8; + if (blank_width 110) + blank_width = 110; - fp_crtc_h_total_disp = mode-crtc_htotal / 8) - 1) 0x3ff) + fp_crtc_h_total_disp = (((blank_width) 0x3ff) | mode-crtc_hdisplay / 8) - 1) 0x1ff) 16)); hsync_wid = (mode-crtc_hsync_end - mode-crtc_hsync_start) / 8; if (!hsync_wid) hsync_wid = 1; - hsync_start = mode-crtc_hsync_start - 8; - fp_h_sync_strt_wid = ((hsync_start 0x1fff) + fp_h_sync_strt_wid = mode-crtc_hsync_start - mode-crtc_hblank_start) / 8) 0x1fff) | ((hsync_wid 0x3f) 16) | ((mode-flags DRM_MODE_FLAG_NHSYNC) ? RADEON_CRTC_H_SYNC_POL : 0)); - fp_crtc_v_total_disp = (((mode-crtc_vtotal - 1) 0x) + fp_crtc_v_total_disp = (((mode-crtc_vblank_end - mode-crtc_vblank_start) 0x) | ((mode-crtc_vdisplay - 1) 16)); vsync_wid = mode-crtc_vsync_end - mode-crtc_vsync_start; if (!vsync_wid) vsync_wid = 1; - fp_v_sync_strt_wid = (((mode-crtc_vsync_start - 1) 0xfff) - | ((vsync_wid 0x1f) 16) - | ((mode-flags DRM_MODE_FLAG_NVSYNC) - ? RADEON_CRTC_V_SYNC_POL - : 0)); + fp_v_sync_strt_wid = mode-crtc_vsync_start - mode-crtc_vblank_start) 0xfff) + | ((vsync_wid 0x1f) 16) + | ((mode-flags DRM_MODE_FLAG_NVSYNC) + ? RADEON_CRTC_V_SYNC_POL : 0))); - fp_horz_vert_active = 0; + fp_horz_vert_active = mode-crtc_vdisplay - 1) 16) 0xfff) | + mode-crtc_hdisplay / 8) - 1) 0x1ff) 16)); if (native_mode-hdisplay == 0 || native_mode-vdisplay == 0) { @@ -156,38 +158,8 @@ static void radeon_legacy_rmx_mode_set(struct drm_crtc *crtc, crtc_more_cntl |= (RADEON_CRTC_AUTO_HORZ_CENTER_EN | RADEON_CRTC_AUTO_VERT_CENTER_EN); - blank_width = (mode-crtc_hblank_end - mode-crtc_hblank_start) / 8; - if (blank_width 110) - blank_width = 110; - - fp_crtc_h_total_disp = (((blank_width) 0x3ff) -| mode-crtc_hdisplay / 8) - 1) 0x1ff) 16)); - - hsync_wid = (mode-crtc_hsync_end - mode-crtc_hsync_start) / 8; - if (!hsync_wid) - hsync_wid = 1; - - fp_h_sync_strt_wid = mode-crtc_hsync_start - mode-crtc_hblank_start) / 8) 0x1fff) -| ((hsync_wid 0x3f) 16) -| ((mode-flags DRM_MODE_FLAG_NHSYNC) - ? RADEON_CRTC_H_SYNC_POL - : 0)); - - fp_crtc_v_total_disp = (((mode-crtc_vblank_end - mode-crtc_vblank_start) 0x) -| ((mode-crtc_vdisplay - 1) 16)); - - vsync_wid = mode-crtc_vsync_end - mode-crtc_vsync_start; - if (!vsync_wid) - vsync_wid = 1; - - fp_v_sync_strt_wid = mode-crtc_vsync_start - mode-crtc_vblank_start) 0xfff) - | ((vsync_wid 0x1f) 16) - | ((mode-flags DRM_MODE_FLAG_NVSYNC) - ? RADEON_CRTC_V_SYNC_POL - : 0))); - - fp_horz_vert_active = (((native_mode-vdisplay) 0xfff) | -(((native_mode-hdisplay / 8) 0x1ff) 16)); + fp_horz_vert_active = (((native_mode-vdisplay - 1) 0xfff) | + native_mode-hdisplay / 8) - 1) 0x1ff) 16)); break;
Re: Q: 'MacModel' replacement for radeon driver?
Hi Alex! Am 20.12.12 22:42 schrieb(en) Alex Deucher: Apple cards have a proprietary rom without that information so we need to hard code it in the driver. I see. And OS X relies on that, so it doesn't work with standard cards... bad! It would be great if you could test both connectors to make sure I got the ddc lines mapped correctly (make sure you can get an edid from the monitor). I tested only with the ADC first; I'll have to find a device with a vga input... I've included several options in the patch for each connector, e.g., + /* DVI-I - tv dac, int tmds */ + ddc_i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0); Does not read any edid data, and ejects with 'Screen(s) found, but none have a usable configuration'. The tft is disabled (put to sleep mode), as the failsafe config cannot open the fb device (disabled in the kernel). + //ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0); Here edid data is read, the log says all is perfect (I think), and the tft is activated, but apparently the output signal is not applied. I.e. I again see the shades/lines/pixels... + //ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0); + //ddc_i2c = combios_setup_i2c_bus(rdev, DDC_MONID, 0, 0); These two behave exactly like DDC_CRT2. I attach the dmesg output and the X logs for all four cases. Thanks again, Albrecht. drv_new_test.tar.bz2 Description: application/bzip-compressed-tar pgpmnt4E235wv.pgp Description: PGP signature ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: Q: 'MacModel' replacement for radeon driver?
On Fri, Dec 21, 2012 at 10:17 AM, Albrecht Dreß albrecht.dr...@arcor.de wrote: Hi Alex! Am 20.12.12 22:42 schrieb(en) Alex Deucher: Apple cards have a proprietary rom without that information so we need to hard code it in the driver. I see. And OS X relies on that, so it doesn't work with standard cards... bad! It would be great if you could test both connectors to make sure I got the ddc lines mapped correctly (make sure you can get an edid from the monitor). I tested only with the ADC first; I'll have to find a device with a vga input... I've included several options in the patch for each connector, e.g., + /* DVI-I - tv dac, int tmds */ + ddc_i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0); Does not read any edid data, and ejects with 'Screen(s) found, but none have a usable configuration'. The tft is disabled (put to sleep mode), as the failsafe config cannot open the fb device (disabled in the kernel). + //ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0); Here edid data is read, the log says all is perfect (I think), and the tft is activated, but apparently the output signal is not applied. I.e. I again see the shades/lines/pixels... Ok, it's definitely DDC_DVI. There's a chance apple used external tmds, but I doubt it. You can try the attached patch. I suspect internal tmds support may just be broken in the driver for some setups. I haven't tested an r1xx card in a while. Alex + //ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0); + //ddc_i2c = combios_setup_i2c_bus(rdev, DDC_MONID, 0, 0); These two behave exactly like DDC_CRT2. I attach the dmesg output and the X logs for all four cases. Thanks again, Albrecht. From c659119a27be71482854b3eaaa81a03fc5ba5aa4 Mon Sep 17 00:00:00 2001 From: Alex Deucher alexander.deuc...@amd.com Date: Thu, 20 Dec 2012 16:35:47 -0500 Subject: [PATCH] drm/radeon: add connector table for Mac G4 Silver (v2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apple cards do not provide data tables in the vbios so we have to hard code the connector parameters in the driver. v2: sort out the ddc line, try external tmds Reported-by: Albrecht Dreß albrecht.dr...@arcor.de Signed-off-by: Alex Deucher alexander.deuc...@amd.com Cc: sta...@vger.kernel.org --- drivers/gpu/drm/radeon/radeon_combios.c | 51 +++ drivers/gpu/drm/radeon/radeon_mode.h|3 +- 2 files changed, 53 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 4af8912..0dcadaa 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c @@ -1548,6 +1548,9 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) of_machine_is_compatible(PowerBook6,7)) { /* ibook */ rdev-mode_info.connector_table = CT_IBOOK; + } else if (of_machine_is_compatible(PowerMac3,5)) { + /* PowerMac G4 Silver radeon 7500 */ + rdev-mode_info.connector_table = CT_MAC_G4_SILVER; } else if (of_machine_is_compatible(PowerMac4,4)) { /* emac */ rdev-mode_info.connector_table = CT_EMAC; @@ -2212,6 +2215,54 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) CONNECTOR_OBJECT_ID_SVIDEO, hpd); break; + case CT_MAC_G4_SILVER: + DRM_INFO(Connector Table: %d (mac g4 silver)\n, + rdev-mode_info.connector_table); + /* DVI - tv dac, dvo */ + ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0); + hpd.hpd = RADEON_HPD_1; /* ??? */ + radeon_add_legacy_encoder(dev, + radeon_get_encoder_enum(dev, + ATOM_DEVICE_DFP2_SUPPORT, + 0), + ATOM_DEVICE_DFP2_SUPPORT); + radeon_add_legacy_encoder(dev, + radeon_get_encoder_enum(dev, + ATOM_DEVICE_CRT2_SUPPORT, + 2), + ATOM_DEVICE_CRT2_SUPPORT); + radeon_add_legacy_connector(dev, 0, + ATOM_DEVICE_DFP2_SUPPORT | + ATOM_DEVICE_CRT2_SUPPORT, + DRM_MODE_CONNECTOR_DVII, ddc_i2c, + CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I, + hpd); + /* VGA - primary dac */ + ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0); + hpd.hpd = RADEON_HPD_NONE; + radeon_add_legacy_encoder(dev, + radeon_get_encoder_enum(dev, +ATOM_DEVICE_CRT1_SUPPORT, +1), + ATOM_DEVICE_CRT1_SUPPORT); + radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT1_SUPPORT, + DRM_MODE_CONNECTOR_VGA, ddc_i2c, + CONNECTOR_OBJECT_ID_VGA, + hpd); + /* TV - TV DAC */ + ddc_i2c.valid = false; + hpd.hpd = RADEON_HPD_NONE; + radeon_add_legacy_encoder(dev, + radeon_get_encoder_enum(dev, +ATOM_DEVICE_TV1_SUPPORT, +2), + ATOM_DEVICE_TV1_SUPPORT); + radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, + DRM_MODE_CONNECTOR_SVIDEO, + ddc_i2c, +
Re: Q: 'MacModel' replacement for radeon driver?
On Fri, Dec 21, 2012 at 12:56 PM, Albrecht Dreß albrecht.dr...@arcor.de wrote: Hi Alex! Am 21.12.12 17:52 schrieb(en) Alex Deucher: Ok, it's definitely DDC_DVI. There's a chance apple used external tmds, but I doubt it. You can try the attached patch. Doesn't work. Yaboot screen appears, and briefly (~1 second) the first boot screen. Then the display flickers, and the shades/lines/pixels appear while the box is booting (in text mode). When X starts, the display flickers again, resetting all the garbage, which then appears again. I suspect internal tmds support may just be broken in the driver for some setups. I haven't tested an r1xx card in a while. Anything I can test there? Where? Sounds like internal tmds may be broken in kms. Probably easiest to dump the registers from a working setup (console fb, or old version of the driver) and a non-working setup (driver with the attached patch applied). Then send me the output. You can use radeonreg available here: http://cgit.freedesktop.org/~airlied/radeontool/ As root, in a working setup run: ./radeonreg regs radeon working.regs then switch to the broken setup and run: ./radeonreg regs radeon broken.regs Alex From f515621516257d896557d1dd2c2e7f2707118cff Mon Sep 17 00:00:00 2001 From: Alex Deucher alexander.deuc...@amd.com Date: Thu, 20 Dec 2012 16:35:47 -0500 Subject: [PATCH] drm/radeon: add connector table for Mac G4 Silver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apple cards do not provide data tables in the vbios so we have to hard code the connector parameters in the driver. Reported-by: Albrecht Dreß albrecht.dr...@arcor.de Signed-off-by: Alex Deucher alexander.deuc...@amd.com Cc: sta...@vger.kernel.org --- drivers/gpu/drm/radeon/radeon_combios.c | 51 +++ drivers/gpu/drm/radeon/radeon_mode.h|3 +- 2 files changed, 53 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 4af8912..33a56a0 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c @@ -1548,6 +1548,9 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) of_machine_is_compatible(PowerBook6,7)) { /* ibook */ rdev-mode_info.connector_table = CT_IBOOK; + } else if (of_machine_is_compatible(PowerMac3,5)) { + /* PowerMac G4 Silver radeon 7500 */ + rdev-mode_info.connector_table = CT_MAC_G4_SILVER; } else if (of_machine_is_compatible(PowerMac4,4)) { /* emac */ rdev-mode_info.connector_table = CT_EMAC; @@ -2212,6 +2215,54 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) CONNECTOR_OBJECT_ID_SVIDEO, hpd); break; + case CT_MAC_G4_SILVER: + DRM_INFO(Connector Table: %d (mac g4 silver)\n, + rdev-mode_info.connector_table); + /* DVI-I - tv dac, int tmds */ + ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0); + hpd.hpd = RADEON_HPD_1; /* ??? */ + radeon_add_legacy_encoder(dev, + radeon_get_encoder_enum(dev, +ATOM_DEVICE_DFP1_SUPPORT, +0), + ATOM_DEVICE_DFP1_SUPPORT); + radeon_add_legacy_encoder(dev, + radeon_get_encoder_enum(dev, +ATOM_DEVICE_CRT2_SUPPORT, +2), + ATOM_DEVICE_CRT2_SUPPORT); + radeon_add_legacy_connector(dev, 0, + ATOM_DEVICE_DFP1_SUPPORT | + ATOM_DEVICE_CRT2_SUPPORT, + DRM_MODE_CONNECTOR_DVII, ddc_i2c, + CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I, + hpd); + /* VGA - primary dac */ + ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0); + hpd.hpd = RADEON_HPD_NONE; + radeon_add_legacy_encoder(dev, + radeon_get_encoder_enum(dev, +ATOM_DEVICE_CRT1_SUPPORT, +1), + ATOM_DEVICE_CRT1_SUPPORT); + radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT1_SUPPORT, + DRM_MODE_CONNECTOR_VGA, ddc_i2c, + CONNECTOR_OBJECT_ID_VGA, + hpd); + /* TV - TV DAC */ + ddc_i2c.valid = false; + hpd.hpd = RADEON_HPD_NONE; + radeon_add_legacy_encoder(dev, + radeon_get_encoder_enum(dev, +ATOM_DEVICE_TV1_SUPPORT, +2), + ATOM_DEVICE_TV1_SUPPORT); + radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, + DRM_MODE_CONNECTOR_SVIDEO, + ddc_i2c, + CONNECTOR_OBJECT_ID_SVIDEO, + hpd); + break; default: DRM_INFO(Connector table: %d (invalid)\n, rdev-mode_info.connector_table); diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index d818b50..ed8a0fa 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h @@ -209,7 +209,8 @@ enum radeon_connector_table { CT_RN50_POWER, CT_MAC_X800, CT_MAC_G5_9600, - CT_SAM440EP + CT_SAM440EP, + CT_MAC_G4_SILVER }; enum radeon_dvo_chip { -- 1.7.7.5 ___ xorg-driver-ati mailing list
Re: Q: 'MacModel' replacement for radeon driver?
Hi Alex! Am 21.12.12 19:44 schrieb(en) Alex Deucher: Sounds like internal tmds may be broken in kms. Probably easiest to dump the registers from a working setup (console fb, or old version of the driver) and a non-working setup (driver with the attached patch applied). Then send me the output. See attached: working Xorg w/ kernel 3.6.5 and fbdev, broken w/ kernel 3.7.1 and radeon driver. Thanks, Albrecht. radeon_regs_g4_silver.tar.bz2 Description: application/bzip-compressed-tar pgpdbchzR1ruf.pgp Description: PGP signature ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Q: 'MacModel' replacement for radeon driver?
Hi all, I am running Ubuntu 12.10 which comes with the radeon driver package '6.99.99~git201209': 8-- root@antares:~# dpkg -l 'xserver-xorg-video-*' [snip] ii xserver-xorg-video-radeon 1:6.99.99~git201209 powerpc X.Org X server -- AMD/ATI Radeon display driver 8-- My box is a PowerMac G4/800 Silver, equipped with a Radeon 7500 AGP card manufactured for Apple, as it has a ADC connector [1] and a DE-15 VGA output. BTW, the kernel reports a *third* S-Video connector which is actually not present: 8-- [drm] Radeon Display Connectors [drm] Connector 0: [drm] DVI-I-1 [drm] HPD1 [drm] DDC: 0x64 0x64 0x64 0x64 0x64 0x64 0x64 0x64 [drm] Encoders: [drm] DFP1: INTERNAL_TMDS1 [drm] CRT2: INTERNAL_DAC2 [drm] Connector 1: [drm] VGA-1 [drm] DDC: 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 [drm] Encoders: [drm] CRT1: INTERNAL_DAC1 [drm] Connector 2: [drm] SVIDEO-1 [drm] Encoders: [drm] TV1: INTERNAL_DAC2 8-- I use a digital Formac TFT, i.e. the kernel connector would be (I think) the 'DFP1' channel of 'DVI-I-1'. Starting with Ubuntu 9.10 (radeon driver 6.12.99), I had to use the Device option 'Option MacModel mini-internal'. Otherwise, the display showed only single pixels, sometimes a blue vertical line, and a greenish shade in some regions. This was apparently caused by an incorrect connector table (i.e. the video signal applied to the wrong output connector), and fixed by this option. However, version 6.99.99 just ignores it (according to the log), and I only get the pixels/line/shades again. Any idea how I could fix this with this driver? Thanks in advance, Albrecht. [1] http://en.wikipedia.org/wiki/Apple_Display_Connector pgpKSfN10l2eo.pgp Description: PGP signature ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: Q: 'MacModel' replacement for radeon driver?
On Thu, Dec 20, 2012 at 1:48 PM, Albrecht Dreß albrecht.dr...@arcor.de wrote: Hi all, I am running Ubuntu 12.10 which comes with the radeon driver package '6.99.99~git201209': 8-- root@antares:~# dpkg -l 'xserver-xorg-video-*' [snip] ii xserver-xorg-video-radeon 1:6.99.99~git201209 powerpc X.Org X server -- AMD/ATI Radeon display driver 8-- My box is a PowerMac G4/800 Silver, equipped with a Radeon 7500 AGP card manufactured for Apple, as it has a ADC connector [1] and a DE-15 VGA output. BTW, the kernel reports a *third* S-Video connector which is actually not present: 8-- [drm] Radeon Display Connectors [drm] Connector 0: [drm] DVI-I-1 [drm] HPD1 [drm] DDC: 0x64 0x64 0x64 0x64 0x64 0x64 0x64 0x64 [drm] Encoders: [drm] DFP1: INTERNAL_TMDS1 [drm] CRT2: INTERNAL_DAC2 [drm] Connector 1: [drm] VGA-1 [drm] DDC: 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 [drm] Encoders: [drm] CRT1: INTERNAL_DAC1 [drm] Connector 2: [drm] SVIDEO-1 [drm] Encoders: [drm] TV1: INTERNAL_DAC2 8-- I use a digital Formac TFT, i.e. the kernel connector would be (I think) the 'DFP1' channel of 'DVI-I-1'. Starting with Ubuntu 9.10 (radeon driver 6.12.99), I had to use the Device option 'Option MacModel mini-internal'. Otherwise, the display showed only single pixels, sometimes a blue vertical line, and a greenish shade in some regions. This was apparently caused by an incorrect connector table (i.e. the video signal applied to the wrong output connector), and fixed by this option. However, version 6.99.99 just ignores it (according to the log), and I only get the pixels/line/shades again. Any idea how I could fix this with this driver? With KMS the display setup is handled by the kernel now, so the MacModel option has been replaced with a kernel module parameter. Specify radeon.connector_table=x where x = enum radeon_connector_table { CT_NONE = 0, CT_GENERIC, CT_IBOOK, CT_POWERBOOK_EXTERNAL, CT_POWERBOOK_INTERNAL, CT_POWERBOOK_VGA, CT_MINI_EXTERNAL, CT_MINI_INTERNAL, CT_IMAC_G5_ISIGHT, CT_EMAC, CT_RN50_POWER, CT_MAC_X800, CT_MAC_G5_9600, CT_SAM440EP }; However, it would be better to add a proper table for your specific model so that you won't have to force some table. Please send me the output of lspci -vnn and the output of /proc/cpuinfo and I can prepare a patch for you to try. Alex Thanks in advance, Albrecht. [1] http://en.wikipedia.org/wiki/Apple_Display_Connector ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: Q: 'MacModel' replacement for radeon driver?
Hi Alex! Thanks a lot for the fast response! Am 20.12.12 20:44 schrieb(en) Alex Deucher: With KMS the display setup is handled by the kernel now, so the MacModel option has been replaced with a kernel module parameter. I see. Makes sense... Specify radeon.connector_table=x where x = Hmmm, is there a documentation somewhere for these parameters? At least for 3.7.1, I don't find it in the kernel docs. However, it would be better to add a proper table for your specific model so that you won't have to force some table. Please send me the output of lspci -vnn and the output of /proc/cpuinfo and I can prepare a patch for you to try. Here we go: root@antares:~# lspci -vnn -s :00:10.0 :00:10.0 VGA compatible controller [0300]: Advanced Micro Devices [AMD] nee ATI RV200 QW [Radeon 7500] [1002:5157] (prog-if 00 [VGA controller]) Subsystem: Advanced Micro Devices [AMD] nee ATI RV200 QW [Radeon 7500] [1002:5157] Flags: bus master, stepping, 66MHz, medium devsel, latency 255, IRQ 48 Memory at 9800 (32-bit, prefetchable) [size=128M] I/O ports at 0400 [size=256] Memory at 9000 (32-bit, non-prefetchable) [size=64K] Expansion ROM at 9002 [size=128K] Capabilities: [58] AGP version 2.0 Capabilities: [50] Power Management version 2 Kernel driver in use: radeonfb Kernel modules: radeon (I know I have to disable the radeonfb driver for the Xorg one to work, but I need *some* display output... ;-) Please note that the Radeon card is an add-on card in the AGP slot. I *think* Apple shipped all PowerMac3,5 boxes with this card, but I'm not sure. Some time ago, I tested it with a different AGP (nvidia?) and a PCI card, which both worked fine on Linux, but they were not detected by Mac OS X Tiger. root@antares:~# cat /proc/cpuinfo processor : 0 cpu : 7450, altivec supported clock : 799.98MHz revision: 2.1 (pvr 8000 0201) bogomips: 66.43 timebase: 33217800 platform: PowerMac model : PowerMac3,5 machine : PowerMac3,5 motherboard : PowerMac3,5 MacRISC2 MacRISC Power Macintosh detected as : 69 (PowerMac G4 Silver) pmac flags : 0010 L2 cache: 256K unified pmac-generation : NewWorld Memory : 1024 MB Btw, if I understand the code in radeon_get_legacy_connector_info_from_table() correctly, CT_MINI_INTERNAL doesn't look like the *really* correct option. My card doesn't have a TV output, but an analogue vga (in addition to the adc which has both digital and analogue signals). Thanks a lot, Albrecht. pgp1XFWbQBdg9.pgp Description: PGP signature ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: Q: 'MacModel' replacement for radeon driver?
On Thu, Dec 20, 2012 at 3:53 PM, Albrecht Dreß albrecht.dr...@arcor.de wrote: Hi Alex! Thanks a lot for the fast response! Am 20.12.12 20:44 schrieb(en) Alex Deucher: With KMS the display setup is handled by the kernel now, so the MacModel option has been replaced with a kernel module parameter. I see. Makes sense... Specify radeon.connector_table=x where x = Hmmm, is there a documentation somewhere for these parameters? At least for 3.7.1, I don't find it in the kernel docs. Not at the moment. Most models are autodetected and we add new models when people report problems. However, it would be better to add a proper table for your specific model so that you won't have to force some table. Please send me the output of lspci -vnn and the output of /proc/cpuinfo and I can prepare a patch for you to try. Here we go: root@antares:~# lspci -vnn -s :00:10.0 :00:10.0 VGA compatible controller [0300]: Advanced Micro Devices [AMD] nee ATI RV200 QW [Radeon 7500] [1002:5157] (prog-if 00 [VGA controller]) Subsystem: Advanced Micro Devices [AMD] nee ATI RV200 QW [Radeon 7500] [1002:5157] Flags: bus master, stepping, 66MHz, medium devsel, latency 255, IRQ 48 Memory at 9800 (32-bit, prefetchable) [size=128M] I/O ports at 0400 [size=256] Memory at 9000 (32-bit, non-prefetchable) [size=64K] Expansion ROM at 9002 [size=128K] Capabilities: [58] AGP version 2.0 Capabilities: [50] Power Management version 2 Kernel driver in use: radeonfb Kernel modules: radeon (I know I have to disable the radeonfb driver for the Xorg one to work, but I need *some* display output... ;-) Please note that the Radeon card is an add-on card in the AGP slot. I *think* Apple shipped all PowerMac3,5 boxes with this card, but I'm not sure. Some time ago, I tested it with a different AGP (nvidia?) and a PCI card, which both worked fine on Linux, but they were not detected by Mac OS X Tiger. PC radeon cards have a rom on them which contains data tables with details about the card (connectors, ddc lines, etc), etc. Apple cards have a proprietary rom without that information so we need to hard code it in the driver. root@antares:~# cat /proc/cpuinfo processor : 0 cpu : 7450, altivec supported clock : 799.98MHz revision: 2.1 (pvr 8000 0201) bogomips: 66.43 timebase: 33217800 platform: PowerMac model : PowerMac3,5 machine : PowerMac3,5 motherboard : PowerMac3,5 MacRISC2 MacRISC Power Macintosh detected as : 69 (PowerMac G4 Silver) pmac flags : 0010 L2 cache: 256K unified pmac-generation : NewWorld Memory : 1024 MB Btw, if I understand the code in radeon_get_legacy_connector_info_from_table() correctly, CT_MINI_INTERNAL doesn't look like the *really* correct option. My card doesn't have a TV output, but an analogue vga (in addition to the adc which has both digital and analogue signals). ADC is basically an apple proprietary DVI-I port. We add the tv-output because IIRC Apple sells a ADC to TV adapter. MINI_INTERNAL is not the correct option, it just happens to work better than the default connector table. I'll attaching a patch to test. It would be great if you could test both connectors to make sure I got the ddc lines mapped correctly (make sure you can get an edid from the monitor). The hardest part is getting the ddc line mapping correct. I've included several options in the patch for each connector, e.g., + /* DVI-I - tv dac, int tmds */ + ddc_i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0); + //ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0); + //ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0); + //ddc_i2c = combios_setup_i2c_bus(rdev, DDC_MONID, 0, 0); and + /* VGA - primary dac */ + ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0); + //ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0); + //ddc_i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0); + //ddc_i2c = combios_setup_i2c_bus(rdev, DDC_MONID, 0, 0); comment or uncomment lines to try different ddc line mappings until you find which line is mapped to which connector. Let me know how it goes and I'll get the patch pushed upstream. Alex Thanks a lot, Albrecht. From 36bebeb63472eca115f70a80ed016da7dfba948f Mon Sep 17 00:00:00 2001 From: Alex Deucher alexander.deuc...@amd.com Date: Thu, 20 Dec 2012 16:35:47 -0500 Subject: [PATCH] drm/radeon: add connector table for Mac G4 Silver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apple cards do not provide data tables in the vbios so we have to hard code the connector parameters in the driver. Reported-by: Albrecht Dreß albrecht.dr...@arcor.de