[PATCH] drm/radeon/kms: add cvt mode if we only have lvds w/h and no edid

2009-12-22 Thread Alex Deucher
From 7c30bc1d04bd87dff00ff80c3cf7d8a0b8cf3e34 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 22 Dec 2009 09:25:22 -0500
Subject: [PATCH] drm/radeon/kms: add cvt mode if we only have lvds w/h
and no edid

This fixes LVDS on some mac laptops without a panel edid.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_connectors.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c
b/drivers/gpu/drm/radeon/radeon_connectors.c
index 8da06e1..0cbd3ef 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -208,6 +208,11 @@ static struct drm_display_mode
*radeon_fp_native_mode(struct drm_encoder *encode
drm_mode_set_name(mode);

DRM_DEBUG(Adding native panel mode %s\n, mode-name);
+   } else if (native_mode-hdisplay != 0 
+  native_mode-vdisplay != 0) {
+   /* mac laptops without an edid */
+   mode = drm_cvt_mode(dev, native_mode-hdisplay,
native_mode-vdisplay, 60, true, false, false);
+   DRM_DEBUG(Adding native panel mode %s\n, mode-name);
}
return mode;
 }
-- 
1.5.6.3
From 7c30bc1d04bd87dff00ff80c3cf7d8a0b8cf3e34 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 22 Dec 2009 09:25:22 -0500
Subject: [PATCH] drm/radeon/kms: add cvt mode if we only have lvds w/h and no edid

This fixes LVDS on some mac laptops without a panel edid.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_connectors.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 8da06e1..0cbd3ef 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -208,6 +208,11 @@ static struct drm_display_mode *radeon_fp_native_mode(struct drm_encoder *encode
 		drm_mode_set_name(mode);
 
 		DRM_DEBUG(Adding native panel mode %s\n, mode-name);
+	} else if (native_mode-hdisplay != 0 
+		   native_mode-vdisplay != 0) {
+		/* mac laptops without an edid */
+		mode = drm_cvt_mode(dev, native_mode-hdisplay, native_mode-vdisplay, 60, true, false, false);
+		DRM_DEBUG(Adding native panel mode %s\n, mode-name);
 	}
 	return mode;
 }
-- 
1.5.6.3

--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev --
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms: add cvt mode if we only have lvds w/h and no edid

2009-12-22 Thread Michel Dänzer
On Tue, 2009-12-22 at 09:30 -0500, Alex Deucher wrote: 
 From 7c30bc1d04bd87dff00ff80c3cf7d8a0b8cf3e34 Mon Sep 17 00:00:00 2001
 From: Alex Deucher alexdeuc...@gmail.com
 Date: Tue, 22 Dec 2009 09:25:22 -0500
 Subject: [PATCH] drm/radeon/kms: add cvt mode if we only have lvds w/h
 and no edid
 
 This fixes LVDS on some mac laptops without a panel edid.
 
 Signed-off-by: Alex Deucher alexdeuc...@gmail.com
 ---
  drivers/gpu/drm/radeon/radeon_connectors.c |5 +
  1 files changed, 5 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c
 b/drivers/gpu/drm/radeon/radeon_connectors.c
 index 8da06e1..0cbd3ef 100644
 --- a/drivers/gpu/drm/radeon/radeon_connectors.c
 +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
 @@ -208,6 +208,11 @@ static struct drm_display_mode
 *radeon_fp_native_mode(struct drm_encoder *encode
   drm_mode_set_name(mode);
 
   DRM_DEBUG(Adding native panel mode %s\n, mode-name);
 + } else if (native_mode-hdisplay != 0 
 +native_mode-vdisplay != 0) {
 + /* mac laptops without an edid */
 + mode = drm_cvt_mode(dev, native_mode-hdisplay,
 native_mode-vdisplay, 60, true, false, false);
 + DRM_DEBUG(Adding native panel mode %s\n, mode-name);

Might be worth reflecting in the message that it's not really the native
mode but a generated approximation of it.


-- 
Earthling Michel Dänzer   |http://www.vmware.com
Libre software enthusiast |  Debian, X and DRI developer

--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms: add cvt mode if we only have lvds w/h and no edid

2009-12-22 Thread Alex Deucher
Whoops. forgot to set the mode flags properly.  New patch attached.

Alex


On Tue, Dec 22, 2009 at 9:30 AM, Alex Deucher alexdeuc...@gmail.com wrote:
 From 7c30bc1d04bd87dff00ff80c3cf7d8a0b8cf3e34 Mon Sep 17 00:00:00 2001
 From: Alex Deucher alexdeuc...@gmail.com
 Date: Tue, 22 Dec 2009 09:25:22 -0500
 Subject: [PATCH] drm/radeon/kms: add cvt mode if we only have lvds w/h
 and no edid

 This fixes LVDS on some mac laptops without a panel edid.

 Signed-off-by: Alex Deucher alexdeuc...@gmail.com
 ---
  drivers/gpu/drm/radeon/radeon_connectors.c |    5 +
  1 files changed, 5 insertions(+), 0 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c
 b/drivers/gpu/drm/radeon/radeon_connectors.c
 index 8da06e1..0cbd3ef 100644
 --- a/drivers/gpu/drm/radeon/radeon_connectors.c
 +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
 @@ -208,6 +208,11 @@ static struct drm_display_mode
 *radeon_fp_native_mode(struct drm_encoder *encode
                drm_mode_set_name(mode);

                DRM_DEBUG(Adding native panel mode %s\n, mode-name);
 +       } else if (native_mode-hdisplay != 0 
 +                  native_mode-vdisplay != 0) {
 +               /* mac laptops without an edid */
 +               mode = drm_cvt_mode(dev, native_mode-hdisplay,
 native_mode-vdisplay, 60, true, false, false);
 +               DRM_DEBUG(Adding native panel mode %s\n, mode-name);
        }
        return mode;
  }
 --
 1.5.6.3

From 2d19eccf417251392b936eca270e940247943cd2 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 22 Dec 2009 09:32:54 -0500
Subject: [PATCH] drm/radeon/kms: add cvt mode if we only have lvds w/h and no edid (v2)

This fixes LVDS on some mac laptops without a panel edid.

v2 - set proper mode type flags

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_connectors.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 8da06e1..b05ed89 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -208,6 +208,12 @@ static struct drm_display_mode *radeon_fp_native_mode(struct drm_encoder *encode
 		drm_mode_set_name(mode);
 
 		DRM_DEBUG(Adding native panel mode %s\n, mode-name);
+	} else if (native_mode-hdisplay != 0 
+		   native_mode-vdisplay != 0) {
+		/* mac laptops without an edid */
+		mode = drm_cvt_mode(dev, native_mode-hdisplay, native_mode-vdisplay, 60, true, false, false);
+		mode-type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER;
+		DRM_DEBUG(Adding native panel mode %s\n, mode-name);
 	}
 	return mode;
 }
-- 
1.5.6.3

--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev --
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms: add cvt mode if we only have lvds w/h and no edid

2009-12-22 Thread Alex Deucher
2009/12/22 Michel Dänzer mic...@daenzer.net:
 On Tue, 2009-12-22 at 09:30 -0500, Alex Deucher wrote:
 From 7c30bc1d04bd87dff00ff80c3cf7d8a0b8cf3e34 Mon Sep 17 00:00:00 2001
 From: Alex Deucher alexdeuc...@gmail.com
 Date: Tue, 22 Dec 2009 09:25:22 -0500
 Subject: [PATCH] drm/radeon/kms: add cvt mode if we only have lvds w/h
 and no edid

 This fixes LVDS on some mac laptops without a panel edid.

 Signed-off-by: Alex Deucher alexdeuc...@gmail.com
 ---
  drivers/gpu/drm/radeon/radeon_connectors.c |    5 +
  1 files changed, 5 insertions(+), 0 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c
 b/drivers/gpu/drm/radeon/radeon_connectors.c
 index 8da06e1..0cbd3ef 100644
 --- a/drivers/gpu/drm/radeon/radeon_connectors.c
 +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
 @@ -208,6 +208,11 @@ static struct drm_display_mode
 *radeon_fp_native_mode(struct drm_encoder *encode
               drm_mode_set_name(mode);

               DRM_DEBUG(Adding native panel mode %s\n, mode-name);
 +     } else if (native_mode-hdisplay != 0 
 +                native_mode-vdisplay != 0) {
 +             /* mac laptops without an edid */
 +             mode = drm_cvt_mode(dev, native_mode-hdisplay,
 native_mode-vdisplay, 60, true, false, false);
 +             DRM_DEBUG(Adding native panel mode %s\n, mode-name);

 Might be worth reflecting in the message that it's not really the native
 mode but a generated approximation of it.

Updated patch (v3) attached.

Alex
From c71e0d7cc0af8958168b0a934caffde310c77b0b Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 22 Dec 2009 09:36:20 -0500
Subject: [PATCH] drm/radeon/kms: add cvt mode if we only have lvds w/h and no edid (v3)

This fixes LVDS on some mac laptops without a panel edid.

v2 - Set proper mode type flags
v3 - Note that this is not neceesarily the exact panel mode,
but an approximation based on the cvt formula.  For these
systems we should ideally read the mode info out of the
registers or add a mode table, but this works and is much
simpler.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_connectors.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 8da06e1..b05ed89 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -208,6 +208,12 @@ static struct drm_display_mode *radeon_fp_native_mode(struct drm_encoder *encode
 		drm_mode_set_name(mode);
 
 		DRM_DEBUG(Adding native panel mode %s\n, mode-name);
+	} else if (native_mode-hdisplay != 0 
+		   native_mode-vdisplay != 0) {
+		/* mac laptops without an edid */
+		mode = drm_cvt_mode(dev, native_mode-hdisplay, native_mode-vdisplay, 60, true, false, false);
+		mode-type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER;
+		DRM_DEBUG(Adding native panel mode %s\n, mode-name);
 	}
 	return mode;
 }
-- 
1.5.6.3

--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev --
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms: add cvt mode if we only have lvds w/h and no edid

2009-12-22 Thread Alex Deucher
2009/12/22 Alex Deucher alexdeuc...@gmail.com:
 2009/12/22 Michel Dänzer mic...@daenzer.net:
 On Tue, 2009-12-22 at 09:30 -0500, Alex Deucher wrote:
 From 7c30bc1d04bd87dff00ff80c3cf7d8a0b8cf3e34 Mon Sep 17 00:00:00 2001
 From: Alex Deucher alexdeuc...@gmail.com
 Date: Tue, 22 Dec 2009 09:25:22 -0500
 Subject: [PATCH] drm/radeon/kms: add cvt mode if we only have lvds w/h
 and no edid

 This fixes LVDS on some mac laptops without a panel edid.

 Signed-off-by: Alex Deucher alexdeuc...@gmail.com
 ---
  drivers/gpu/drm/radeon/radeon_connectors.c |    5 +
  1 files changed, 5 insertions(+), 0 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c
 b/drivers/gpu/drm/radeon/radeon_connectors.c
 index 8da06e1..0cbd3ef 100644
 --- a/drivers/gpu/drm/radeon/radeon_connectors.c
 +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
 @@ -208,6 +208,11 @@ static struct drm_display_mode
 *radeon_fp_native_mode(struct drm_encoder *encode
               drm_mode_set_name(mode);

               DRM_DEBUG(Adding native panel mode %s\n, mode-name);
 +     } else if (native_mode-hdisplay != 0 
 +                native_mode-vdisplay != 0) {
 +             /* mac laptops without an edid */
 +             mode = drm_cvt_mode(dev, native_mode-hdisplay,
 native_mode-vdisplay, 60, true, false, false);
 +             DRM_DEBUG(Adding native panel mode %s\n, mode-name);

 Might be worth reflecting in the message that it's not really the native
 mode but a generated approximation of it.

 Updated patch (v3) attached.

V4 attached with updated comments and debug message.

Alex
From 24e62e009546a44ee042e9bb83a0716674aa1c2c Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 22 Dec 2009 10:06:49 -0500
Subject: [PATCH] drm/radeon/kms: add cvt mode if we only have lvds w/h and no edid (v4)

This fixes LVDS on some mac laptops without a panel edid.

v2 - Set proper mode type flags
v3 - Note that this is not neceesarily the exact panel mode,
but an approximation based on the cvt formula.  For these
systems we should ideally read the mode info out of the
registers or add a mode table, but this works and is much
simpler.
v4 - Update comments and debug message.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_connectors.c |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 8da06e1..2016156 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -208,6 +208,18 @@ static struct drm_display_mode *radeon_fp_native_mode(struct drm_encoder *encode
 		drm_mode_set_name(mode);
 
 		DRM_DEBUG(Adding native panel mode %s\n, mode-name);
+	} else if (native_mode-hdisplay != 0 
+		   native_mode-vdisplay != 0) {
+		/* mac laptops without an edid */
+		/* Note that this is not necessarily the exact panel mode,
+		 * but an approximation based on the cvt formula.  For these
+		 * systems we should ideally read the mode info out of the
+		 * registers or add a mode table, but this works and is much
+		 * simpler.
+		 */
+		mode = drm_cvt_mode(dev, native_mode-hdisplay, native_mode-vdisplay, 60, true, false, false);
+		mode-type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER;
+		DRM_DEBUG(Adding cvt approximation of native panel mode %s\n, mode-name);
 	}
 	return mode;
 }
-- 
1.5.6.3

--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev --
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel