* [PATCH 2.6.17-1] radeonfb: use generic ddc read functionality
@ 2006-06-21 20:52 Dennis Munsie
2006-06-22 0:22 ` Robert Siemer
0 siblings, 1 reply; 2+ messages in thread
From: Dennis Munsie @ 2006-06-21 20:52 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: Eric Hustvedt
hello --
here is that patch i promised in my last email. This simply changes
the radeonfb driver from using it's current method of reading the
EDID block to using the new functionality that I put into fbmon.c.
I've been able to test it on a radeon card I have here, and it
appears to work just fine. Again, I would like to get some feedback
from other people that I haven't broke it for their configuration.
while i'm thinking of it, there are other drivers that appear to have
their own code to handle reading the EDID over DDC. I would modify
these in the same manor as the radeonfb driver, but I don't have any
of the cards to even test with. It should be a straightforward
modification if anyone wants to try it out. The drivers are: i810,
matrox, riva, savage, and possibly sis. There are a few drivers that
setup DDC busses, but in my quick scan, I couldn't tell if they
actually use them or not.
dennis
---
From: Dennis Munsie <dmunsie@cecropia.com>
Uses the generic ddc read functionality in fbmon.c instead of the
previous functionality.
Signed-off-by: Dennis Munsie <dmunsie@cecropia.com>
---
drivers/video/aty/radeon_i2c.c | 104
-----------------------------------------
1 file changed, 1 insertion(+), 103 deletions(-)
diff -Naurp -X linux-2.6.17.1-patched/Documentation/dontdiff
linux-2.6.17.1-patched/drivers/video/aty/radeon_i2c.c linux/drivers/
video/aty/radeon_i2c.c
--- linux-2.6.17.1-patched/drivers/video/aty/radeon_i2c.c 2006-03-20
00:53:29.000000000 -0500
+++ linux/drivers/video/aty/radeon_i2c.c 2006-06-21
15:45:53.000000000 -0500
@@ -17,8 +17,6 @@
#include "radeonfb.h"
#include "../edid.h"
-#define RADEON_DDC 0x50
-
static void radeon_gpio_setscl(void* data, int state)
{
struct radeon_i2c_chan *chan = data;
@@ -139,109 +137,9 @@ void radeon_delete_i2c_busses(struct rad
rinfo->i2c[3].rinfo = NULL;
}
-
-static u8 *radeon_do_probe_i2c_edid(struct radeon_i2c_chan *chan)
-{
- u8 start = 0x0;
- struct i2c_msg msgs[] = {
- {
- .addr = RADEON_DDC,
- .len = 1,
- .buf = &start,
- }, {
- .addr = RADEON_DDC,
- .flags = I2C_M_RD,
- .len = EDID_LENGTH,
- },
- };
- u8 *buf;
-
- buf = kmalloc(EDID_LENGTH, GFP_KERNEL);
- if (!buf) {
- dev_warn(&chan->rinfo->pdev->dev, "Out of memory!\n");
- return NULL;
- }
- msgs[1].buf = buf;
-
- if (i2c_transfer(&chan->adapter, msgs, 2) == 2)
- return buf;
- dev_dbg(&chan->rinfo->pdev->dev, "Unable to read EDID block.\n");
- kfree(buf);
- return NULL;
-}
-
-
int radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int conn,
u8 **out_edid)
{
- u32 reg = rinfo->i2c[conn-1].ddc_reg;
- u8 *edid = NULL;
- int i, j;
-
- OUTREG(reg, INREG(reg) &
- ~(VGA_DDC_DATA_OUTPUT | VGA_DDC_CLK_OUTPUT));
-
- OUTREG(reg, INREG(reg) & ~(VGA_DDC_CLK_OUT_EN));
- (void)INREG(reg);
-
- for (i = 0; i < 3; i++) {
- /* For some old monitors we need the
- * following process to initialize/stop DDC
- */
- OUTREG(reg, INREG(reg) & ~(VGA_DDC_DATA_OUT_EN));
- (void)INREG(reg);
- msleep(13);
-
- OUTREG(reg, INREG(reg) & ~(VGA_DDC_CLK_OUT_EN));
- (void)INREG(reg);
- for (j = 0; j < 5; j++) {
- msleep(10);
- if (INREG(reg) & VGA_DDC_CLK_INPUT)
- break;
- }
- if (j == 5)
- continue;
-
- OUTREG(reg, INREG(reg) | VGA_DDC_DATA_OUT_EN);
- (void)INREG(reg);
- msleep(15);
- OUTREG(reg, INREG(reg) | VGA_DDC_CLK_OUT_EN);
- (void)INREG(reg);
- msleep(15);
- OUTREG(reg, INREG(reg) & ~(VGA_DDC_DATA_OUT_EN));
- (void)INREG(reg);
- msleep(15);
-
- /* Do the real work */
- edid = radeon_do_probe_i2c_edid(&rinfo->i2c[conn-1]);
-
- OUTREG(reg, INREG(reg) |
- (VGA_DDC_DATA_OUT_EN | VGA_DDC_CLK_OUT_EN));
- (void)INREG(reg);
- msleep(15);
-
- OUTREG(reg, INREG(reg) & ~(VGA_DDC_CLK_OUT_EN));
- (void)INREG(reg);
- for (j = 0; j < 10; j++) {
- msleep(10);
- if (INREG(reg) & VGA_DDC_CLK_INPUT)
- break;
- }
-
- OUTREG(reg, INREG(reg) & ~(VGA_DDC_DATA_OUT_EN));
- (void)INREG(reg);
- msleep(15);
- OUTREG(reg, INREG(reg) |
- (VGA_DDC_DATA_OUT_EN | VGA_DDC_CLK_OUT_EN));
- (void)INREG(reg);
- if (edid)
- break;
- }
- /* Release the DDC lines when done or the Apple Cinema HD display
- * will switch off
- */
- OUTREG(reg, INREG(reg) & ~(VGA_DDC_CLK_OUT_EN | VGA_DDC_DATA_OUT_EN));
- (void)INREG(reg);
-
+ u8 *edid = fb_ddc_read(&rinfo->i2c[conn-1].adapter);
if (out_edid)
*out_edid = edid;
if (!edid) {
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 2.6.17-1] radeonfb: use generic ddc read functionality
2006-06-21 20:52 [PATCH 2.6.17-1] radeonfb: use generic ddc read functionality Dennis Munsie
@ 2006-06-22 0:22 ` Robert Siemer
0 siblings, 0 replies; 2+ messages in thread
From: Robert Siemer @ 2006-06-22 0:22 UTC (permalink / raw)
To: linux-fbdev-devel
On Wed, Jun 21, 2006 at 04:52:06PM -0400, Dennis Munsie wrote:
> hello --
>
> here is that patch i promised in my last email. This simply changes
> the radeonfb driver from using it's current method of reading the
> EDID block to using the new functionality that I put into fbmon.c.
> I've been able to test it on a radeon card I have here, and it
> appears to work just fine. Again, I would like to get some feedback
> from other people that I haven't broke it for their configuration.
Really? I got no comment on my email... <-:
I switched from 2.6.14 to 2.6.16 and trusted the DDC code. - radeonfb
switched to a 200Hz refresh mode. My monitor can handle only 160Hz.
I'm still not sure if the monitor is to blame but it makes not a real
differance:
There should be a 100 or 120Hz cut-off as more is not better but worse
(energy consumption, monitor aging).
I just booted a DDC enabled kernel with cmdline
video=radeonfb:1024x768@100, works fine...
Okay, the faulty seems my monitor:
ddcprobe (from edid: line on) says:
edid:
edid: 1 1
id: 0202
eisa: EIZ0202
serial: 00000000
manufacture: 2 1996
input: separate sync, composite sync, sync on green, analog signal.
screensize: 31 23
gamma: 1.800000
dpms: RGB, active off, suspend, standby
timing: 800x600@60 Hz (VESA)
timing: 800x600@72 Hz (VESA)
timing: 1024x768@70 Hz (VESA)
monitorid: 7 V
dtiming: 1x1@642500
dtiming: 1x1@642500
dtiming: 1x1@642500
Okay, worthless. Maybe there should be just some sanity checking which
in my case would skip the dtiming values... Just for people with old
hardware combinations!? (In my very case there is no workaround a video=
line... Shame on EIZO.)
Something like minimal resolution, e.g. 320x160?
Some future prove max resolution: 10240x7680
Refresh cut-offs: 20-120Hz
Or at least a documentation file in the kernel/Documentation/fb/ tree
telling about the general fb kernel command line arguments. These could
include a "ddc=off" or a "ddc=debug". The latter would print the EDID
values without using them. The printing could be default...
Bye,
Robert
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-22 0:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-21 20:52 [PATCH 2.6.17-1] radeonfb: use generic ddc read functionality Dennis Munsie
2006-06-22 0:22 ` Robert Siemer
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).