All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Patch to fix swapping of front and back porches when reading from modedb.c
  2010-09-08 13:39 Patch to fix swapping of front and back porches when reading from modedb.c Tasslehoff Kjappfot
@ 2010-09-08 13:38 ` Russ Dill
  2010-09-08 13:47   ` Tasslehoff Kjappfot
  2010-09-09  8:28   ` Tomi Valkeinen
  0 siblings, 2 replies; 4+ messages in thread
From: Russ Dill @ 2010-09-08 13:38 UTC (permalink / raw)
  To: Tasslehoff Kjappfot; +Cc: linux-omap

On Wed, Sep 8, 2010 at 6:39 AM, Tasslehoff Kjappfot <tasskjapp@gmail.com> wrote:
>
>
> Hi list :-)
>
> I had trouble getting a standard 800x600@60Hz VGA signal to display
> correctly on my monitors. Measuring the output showed that the front and
> back porches were swapped both for hsync and vsync. After reading the source
> I think I found the error in drivers/video/omap2/omapfb/omapfb-main.c. Patch
> attached.
>
> http://www.xfree86.org/3.3.6/fbdev6.html shows the way it should be, but
> todays code sets:
>
> hfp = left margin
> hbp = right margin
> vfp = upper margin
> vbp = lower margin
>
> I tested a patched kernel with 800x600@60Hz on two different monitors and a
> vga grabber, and it solved my issues.

This looks good. Before this came up, I also thought that front porch
meant left margin, and back porch meant margin, but margins are named
in relation to pixel data, and porches are named in relation to sync
pulses.

You might want to add a Signed-off-by line

Reviewed-by: Russ.Dill@gmail.com

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

* Patch to fix swapping of front and back porches when reading from modedb.c
@ 2010-09-08 13:39 Tasslehoff Kjappfot
  2010-09-08 13:38 ` Russ Dill
  0 siblings, 1 reply; 4+ messages in thread
From: Tasslehoff Kjappfot @ 2010-09-08 13:39 UTC (permalink / raw)
  To: linux-omap

[-- Attachment #1: Type: text/plain, Size: 623 bytes --]



Hi list :-)

I had trouble getting a standard 800x600@60Hz VGA signal to display correctly on my monitors. Measuring the output showed that the front and back porches were swapped both for hsync and vsync. After reading the source I think I found the error in drivers/video/omap2/omapfb/omapfb-main.c. Patch attached.

http://www.xfree86.org/3.3.6/fbdev6.html shows the way it should be, but todays code sets:

hfp = left margin
hbp = right margin
vfp = upper margin
vbp = lower margin

I tested a patched kernel with 800x600@60Hz on two different monitors and a vga grabber, and it solved my issues.

Regards,
Tassle




[-- Attachment #2: 0001-swap-front-and-back-porches-for-both-hsync-and-vsync.patch --]
[-- Type: text/x-patch, Size: 1658 bytes --]

>From f6a0d18c16bfc827e18356b11c4e3cd96b836787 Mon Sep 17 00:00:00 2001
From: Tasslehoff Kjappfot <tasskjapp@gmail.com>
Date: Wed, 8 Sep 2010 12:46:14 +0200
Subject: [PATCH] swap front and back porches for both hsync and vsync

---
 drivers/video/omap2/omapfb/omapfb-main.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 015831b..69e6a08 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -711,10 +711,10 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
 		var->pixclock = timings.pixel_clock != 0 ?
 			KHZ2PICOS(timings.pixel_clock) :
 			0;
-		var->left_margin = timings.hfp;
-		var->right_margin = timings.hbp;
-		var->upper_margin = timings.vfp;
-		var->lower_margin = timings.vbp;
+		var->left_margin = timings.hbp;
+		var->right_margin = timings.hfp;
+		var->upper_margin = timings.vbp;
+		var->lower_margin = timings.vfp;
 		var->hsync_len = timings.hsw;
 		var->vsync_len = timings.vsw;
 	} else {
@@ -1992,10 +1992,10 @@ static int omapfb_mode_to_timings(const char *mode_str,
 
 	if (r != 0) {
 		timings->pixel_clock = PICOS2KHZ(var.pixclock);
-		timings->hfp = var.left_margin;
-		timings->hbp = var.right_margin;
-		timings->vfp = var.upper_margin;
-		timings->vbp = var.lower_margin;
+		timings->hbp = var.left_margin;
+		timings->hfp = var.right_margin;
+		timings->vbp = var.upper_margin;
+		timings->vfp = var.lower_margin;
 		timings->hsw = var.hsync_len;
 		timings->vsw = var.vsync_len;
 		timings->x_res = var.xres;
-- 
1.7.0.4


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

* Re: Patch to fix swapping of front and back porches when reading from modedb.c
  2010-09-08 13:38 ` Russ Dill
@ 2010-09-08 13:47   ` Tasslehoff Kjappfot
  2010-09-09  8:28   ` Tomi Valkeinen
  1 sibling, 0 replies; 4+ messages in thread
From: Tasslehoff Kjappfot @ 2010-09-08 13:47 UTC (permalink / raw)
  To: linux-omap

  On 09/08/2010 03:38 PM, Russ Dill wrote:
> On Wed, Sep 8, 2010 at 6:39 AM, Tasslehoff Kjappfot<tasskjapp@gmail.com>  wrote:
>>
>> Hi list :-)
>>
>> I had trouble getting a standard 800x600@60Hz VGA signal to display
>> correctly on my monitors. Measuring the output showed that the front and
>> back porches were swapped both for hsync and vsync. After reading the source
>> I think I found the error in drivers/video/omap2/omapfb/omapfb-main.c. Patch
>> attached.
>>
>> http://www.xfree86.org/3.3.6/fbdev6.html shows the way it should be, but
>> todays code sets:
>>
>> hfp = left margin
>> hbp = right margin
>> vfp = upper margin
>> vbp = lower margin
>>
>> I tested a patched kernel with 800x600@60Hz on two different monitors and a
>> vga grabber, and it solved my issues.
> This looks good. Before this came up, I also thought that front porch
> meant left margin, and back porch meant margin, but margins are named
> in relation to pixel data, and porches are named in relation to sync
> pulses.
>
> You might want to add a Signed-off-by line
>
> Reviewed-by: Russ.Dill@gmail.com

Signed-off-by: tasskjapp@gmail.com


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

* Re: Patch to fix swapping of front and back porches when reading from modedb.c
  2010-09-08 13:38 ` Russ Dill
  2010-09-08 13:47   ` Tasslehoff Kjappfot
@ 2010-09-09  8:28   ` Tomi Valkeinen
  1 sibling, 0 replies; 4+ messages in thread
From: Tomi Valkeinen @ 2010-09-09  8:28 UTC (permalink / raw)
  To: ext Russ Dill, Tasslehoff Kjappfot; +Cc: linux-omap

On Wed, 2010-09-08 at 15:38 +0200, ext Russ Dill wrote:
> On Wed, Sep 8, 2010 at 6:39 AM, Tasslehoff Kjappfot <tasskjapp@gmail.com> wrote:
> >
> >
> > Hi list :-)
> >
> > I had trouble getting a standard 800x600@60Hz VGA signal to display
> > correctly on my monitors. Measuring the output showed that the front and
> > back porches were swapped both for hsync and vsync. After reading the source
> > I think I found the error in drivers/video/omap2/omapfb/omapfb-main.c. Patch
> > attached.
> >
> > http://www.xfree86.org/3.3.6/fbdev6.html shows the way it should be, but
> > todays code sets:
> >
> > hfp = left margin
> > hbp = right margin
> > vfp = upper margin
> > vbp = lower margin
> >
> > I tested a patched kernel with 800x600@60Hz on two different monitors and a
> > vga grabber, and it solved my issues.
> 
> This looks good. Before this came up, I also thought that front porch
> meant left margin, and back porch meant margin, but margins are named
> in relation to pixel data, and porches are named in relation to sync
> pulses.

Ah, that's new to me too =). After a few minutes of googling, it's quite
clear that the patch is correct.

Thanks! I improved the patch description a bit, and added it to my tree.

 Tomi



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

end of thread, other threads:[~2010-09-09  8:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-08 13:39 Patch to fix swapping of front and back porches when reading from modedb.c Tasslehoff Kjappfot
2010-09-08 13:38 ` Russ Dill
2010-09-08 13:47   ` Tasslehoff Kjappfot
2010-09-09  8:28   ` Tomi Valkeinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.