All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] video: fbdev: atari: Miscellaneous fixes
@ 2022-02-15 11:21 ` Geert Uytterhoeven
  0 siblings, 0 replies; 10+ messages in thread
From: Geert Uytterhoeven @ 2022-02-15 11:21 UTC (permalink / raw)
  To: Helge Deller
  Cc: Michael Schmitz, linux-fbdev, dri-devel, linux-m68k, Geert Uytterhoeven

	Hi Helge,

This is a small series of miscellaneous fixes for the Atari frame buffer
device driver.

The first patch has been sent before, and is untested, as I have no
access to the hardware.
The other patches have been tested on ARAnyM.

Thanks!

Geert Uytterhoeven (3):
  video: fbdev: atari: Fix TT High video mode
  video: fbdev: atari: Convert to standard round_up() helper
  video: fbdev: atari: Remove unused atafb_setcolreg()

 drivers/video/fbdev/atafb.c | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)

-- 
2.25.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* [PATCH 0/3] video: fbdev: atari: Miscellaneous fixes
@ 2022-02-15 11:21 ` Geert Uytterhoeven
  0 siblings, 0 replies; 10+ messages in thread
From: Geert Uytterhoeven @ 2022-02-15 11:21 UTC (permalink / raw)
  To: Helge Deller
  Cc: Michael Schmitz, linux-fbdev, Geert Uytterhoeven, linux-m68k, dri-devel

	Hi Helge,

This is a small series of miscellaneous fixes for the Atari frame buffer
device driver.

The first patch has been sent before, and is untested, as I have no
access to the hardware.
The other patches have been tested on ARAnyM.

Thanks!

Geert Uytterhoeven (3):
  video: fbdev: atari: Fix TT High video mode
  video: fbdev: atari: Convert to standard round_up() helper
  video: fbdev: atari: Remove unused atafb_setcolreg()

 drivers/video/fbdev/atafb.c | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)

-- 
2.25.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* [PATCH 1/3] video: fbdev: atari: Fix TT High video mode
  2022-02-15 11:21 ` Geert Uytterhoeven
@ 2022-02-15 11:21   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 10+ messages in thread
From: Geert Uytterhoeven @ 2022-02-15 11:21 UTC (permalink / raw)
  To: Helge Deller
  Cc: Michael Schmitz, linux-fbdev, dri-devel, linux-m68k, Geert Uytterhoeven

The horizontal resolution (640) for the TT High video mode (1280x960) is
definitely bogus.  While fixing that, correct the timings to match the
TTM195 service manual.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Untested on actual hardware.

v3:
  - Adjust pixclock from 7761 to 7760 to match 4 * 32.215905 MHz
    crystal oscillator frequency,
  - Make it part of a series.

v2[1]:
  - Use correct base.

[1] https://lore.kernel.org/r/20201101102759.2890612-1-geert@linux-m68k.org/
---
 drivers/video/fbdev/atafb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c
index e3812a8ff55a4fb8..a9f25cab4a1e6737 100644
--- a/drivers/video/fbdev/atafb.c
+++ b/drivers/video/fbdev/atafb.c
@@ -487,8 +487,8 @@ static struct fb_videomode atafb_modedb[] __initdata = {
 		"tt-mid", 60, 640, 480, 31041, 120, 100, 8, 16, 140, 30,
 		0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP
 	}, {
-		/* 1280x960, 29 kHz, 60 Hz (TT high) */
-		"tt-high", 57, 640, 960, 31041, 120, 100, 8, 16, 140, 30,
+		/* 1280x960, 72 kHz, 72 Hz (TT high) */
+		"tt-high", 57, 1280, 960, 7760, 260, 60, 36, 4, 192, 4,
 		0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP
 	},
 
-- 
2.25.1


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

* [PATCH 1/3] video: fbdev: atari: Fix TT High video mode
@ 2022-02-15 11:21   ` Geert Uytterhoeven
  0 siblings, 0 replies; 10+ messages in thread
From: Geert Uytterhoeven @ 2022-02-15 11:21 UTC (permalink / raw)
  To: Helge Deller
  Cc: Michael Schmitz, linux-fbdev, Geert Uytterhoeven, linux-m68k, dri-devel

The horizontal resolution (640) for the TT High video mode (1280x960) is
definitely bogus.  While fixing that, correct the timings to match the
TTM195 service manual.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Untested on actual hardware.

v3:
  - Adjust pixclock from 7761 to 7760 to match 4 * 32.215905 MHz
    crystal oscillator frequency,
  - Make it part of a series.

v2[1]:
  - Use correct base.

[1] https://lore.kernel.org/r/20201101102759.2890612-1-geert@linux-m68k.org/
---
 drivers/video/fbdev/atafb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c
index e3812a8ff55a4fb8..a9f25cab4a1e6737 100644
--- a/drivers/video/fbdev/atafb.c
+++ b/drivers/video/fbdev/atafb.c
@@ -487,8 +487,8 @@ static struct fb_videomode atafb_modedb[] __initdata = {
 		"tt-mid", 60, 640, 480, 31041, 120, 100, 8, 16, 140, 30,
 		0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP
 	}, {
-		/* 1280x960, 29 kHz, 60 Hz (TT high) */
-		"tt-high", 57, 640, 960, 31041, 120, 100, 8, 16, 140, 30,
+		/* 1280x960, 72 kHz, 72 Hz (TT high) */
+		"tt-high", 57, 1280, 960, 7760, 260, 60, 36, 4, 192, 4,
 		0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP
 	},
 
-- 
2.25.1


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

* [PATCH 2/3] video: fbdev: atari: Convert to standard round_up() helper
  2022-02-15 11:21 ` Geert Uytterhoeven
@ 2022-02-15 11:21   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 10+ messages in thread
From: Geert Uytterhoeven @ 2022-02-15 11:21 UTC (permalink / raw)
  To: Helge Deller
  Cc: Michael Schmitz, linux-fbdev, dri-devel, linux-m68k, Geert Uytterhoeven

Remove the custom macro up(), and convert the code to use the standard
round_up() helper instead.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/video/fbdev/atafb.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c
index a9f25cab4a1e6737..b9d6aaaeae43f2f1 100644
--- a/drivers/video/fbdev/atafb.c
+++ b/drivers/video/fbdev/atafb.c
@@ -76,8 +76,6 @@
 #define SWITCH_SND7 0x80
 #define SWITCH_NONE 0x00
 
-#define up(x, r) (((x) + (r) - 1) & ~((r)-1))
-
 
 static int default_par;		/* default resolution (0=none) */
 
@@ -1649,12 +1647,12 @@ static int falcon_pan_display(struct fb_var_screeninfo *var,
 	int bpp = info->var.bits_per_pixel;
 
 	if (bpp == 1)
-		var->xoffset = up(var->xoffset, 32);
+		var->xoffset = round_up(var->xoffset, 32);
 	if (bpp != 16)
 		par->hw.falcon.xoffset = var->xoffset & 15;
 	else {
 		par->hw.falcon.xoffset = 0;
-		var->xoffset = up(var->xoffset, 2);
+		var->xoffset = round_up(var->xoffset, 2);
 	}
 	par->hw.falcon.line_offset = bpp *
 		(info->var.xres_virtual - info->var.xres) / 16;
@@ -2268,7 +2266,7 @@ static int pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
 	if (!fbhw->set_screen_base ||
 	    (!ATARIHW_PRESENT(EXTD_SHIFTER) && var->xoffset))
 		return -EINVAL;
-	var->xoffset = up(var->xoffset, 16);
+	var->xoffset = round_up(var->xoffset, 16);
 	par->screen_base = screen_base +
 	        (var->yoffset * info->var.xres_virtual + var->xoffset)
 	        * info->var.bits_per_pixel / 8;
-- 
2.25.1


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

* [PATCH 2/3] video: fbdev: atari: Convert to standard round_up() helper
@ 2022-02-15 11:21   ` Geert Uytterhoeven
  0 siblings, 0 replies; 10+ messages in thread
From: Geert Uytterhoeven @ 2022-02-15 11:21 UTC (permalink / raw)
  To: Helge Deller
  Cc: Michael Schmitz, linux-fbdev, Geert Uytterhoeven, linux-m68k, dri-devel

Remove the custom macro up(), and convert the code to use the standard
round_up() helper instead.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/video/fbdev/atafb.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c
index a9f25cab4a1e6737..b9d6aaaeae43f2f1 100644
--- a/drivers/video/fbdev/atafb.c
+++ b/drivers/video/fbdev/atafb.c
@@ -76,8 +76,6 @@
 #define SWITCH_SND7 0x80
 #define SWITCH_NONE 0x00
 
-#define up(x, r) (((x) + (r) - 1) & ~((r)-1))
-
 
 static int default_par;		/* default resolution (0=none) */
 
@@ -1649,12 +1647,12 @@ static int falcon_pan_display(struct fb_var_screeninfo *var,
 	int bpp = info->var.bits_per_pixel;
 
 	if (bpp == 1)
-		var->xoffset = up(var->xoffset, 32);
+		var->xoffset = round_up(var->xoffset, 32);
 	if (bpp != 16)
 		par->hw.falcon.xoffset = var->xoffset & 15;
 	else {
 		par->hw.falcon.xoffset = 0;
-		var->xoffset = up(var->xoffset, 2);
+		var->xoffset = round_up(var->xoffset, 2);
 	}
 	par->hw.falcon.line_offset = bpp *
 		(info->var.xres_virtual - info->var.xres) / 16;
@@ -2268,7 +2266,7 @@ static int pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
 	if (!fbhw->set_screen_base ||
 	    (!ATARIHW_PRESENT(EXTD_SHIFTER) && var->xoffset))
 		return -EINVAL;
-	var->xoffset = up(var->xoffset, 16);
+	var->xoffset = round_up(var->xoffset, 16);
 	par->screen_base = screen_base +
 	        (var->yoffset * info->var.xres_virtual + var->xoffset)
 	        * info->var.bits_per_pixel / 8;
-- 
2.25.1


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

* [PATCH 3/3] video: fbdev: atari: Remove unused atafb_setcolreg()
  2022-02-15 11:21 ` Geert Uytterhoeven
@ 2022-02-15 11:21   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 10+ messages in thread
From: Geert Uytterhoeven @ 2022-02-15 11:21 UTC (permalink / raw)
  To: Helge Deller
  Cc: Michael Schmitz, linux-fbdev, dri-devel, linux-m68k, Geert Uytterhoeven

atafb_probe() overrides the atafb_ops.fb_setcolreg() method to match the
actual graphics hardware.  Besides, the shifts by 8 were bogus, as the
individual .fb_setcolreg() implementations already take care of that.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/video/fbdev/atafb.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c
index b9d6aaaeae43f2f1..e95333e004744bf5 100644
--- a/drivers/video/fbdev/atafb.c
+++ b/drivers/video/fbdev/atafb.c
@@ -2404,16 +2404,6 @@ static void atafb_set_disp(struct fb_info *info)
 				atari_stram_to_virt(info->fix.smem_start));
 }
 
-static int atafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
-			   u_int transp, struct fb_info *info)
-{
-	red >>= 8;
-	green >>= 8;
-	blue >>= 8;
-
-	return info->fbops->fb_setcolreg(regno, red, green, blue, transp, info);
-}
-
 static int
 atafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
 {
@@ -2724,7 +2714,6 @@ static struct fb_ops atafb_ops = {
 	.owner =	THIS_MODULE,
 	.fb_check_var	= atafb_check_var,
 	.fb_set_par	= atafb_set_par,
-	.fb_setcolreg	= atafb_setcolreg,
 	.fb_blank =	atafb_blank,
 	.fb_pan_display	= atafb_pan_display,
 	.fb_fillrect	= atafb_fillrect,
-- 
2.25.1


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

* [PATCH 3/3] video: fbdev: atari: Remove unused atafb_setcolreg()
@ 2022-02-15 11:21   ` Geert Uytterhoeven
  0 siblings, 0 replies; 10+ messages in thread
From: Geert Uytterhoeven @ 2022-02-15 11:21 UTC (permalink / raw)
  To: Helge Deller
  Cc: Michael Schmitz, linux-fbdev, Geert Uytterhoeven, linux-m68k, dri-devel

atafb_probe() overrides the atafb_ops.fb_setcolreg() method to match the
actual graphics hardware.  Besides, the shifts by 8 were bogus, as the
individual .fb_setcolreg() implementations already take care of that.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/video/fbdev/atafb.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c
index b9d6aaaeae43f2f1..e95333e004744bf5 100644
--- a/drivers/video/fbdev/atafb.c
+++ b/drivers/video/fbdev/atafb.c
@@ -2404,16 +2404,6 @@ static void atafb_set_disp(struct fb_info *info)
 				atari_stram_to_virt(info->fix.smem_start));
 }
 
-static int atafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
-			   u_int transp, struct fb_info *info)
-{
-	red >>= 8;
-	green >>= 8;
-	blue >>= 8;
-
-	return info->fbops->fb_setcolreg(regno, red, green, blue, transp, info);
-}
-
 static int
 atafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
 {
@@ -2724,7 +2714,6 @@ static struct fb_ops atafb_ops = {
 	.owner =	THIS_MODULE,
 	.fb_check_var	= atafb_check_var,
 	.fb_set_par	= atafb_set_par,
-	.fb_setcolreg	= atafb_setcolreg,
 	.fb_blank =	atafb_blank,
 	.fb_pan_display	= atafb_pan_display,
 	.fb_fillrect	= atafb_fillrect,
-- 
2.25.1


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

* Re: [PATCH 0/3] video: fbdev: atari: Miscellaneous fixes
  2022-02-15 11:21 ` Geert Uytterhoeven
@ 2022-02-15 20:36   ` Helge Deller
  -1 siblings, 0 replies; 10+ messages in thread
From: Helge Deller @ 2022-02-15 20:36 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Michael Schmitz, linux-fbdev, dri-devel, linux-m68k

Hi Geert,

On 2/15/22 12:21, Geert Uytterhoeven wrote:
> This is a small series of miscellaneous fixes for the Atari frame buffer
> device driver.
>
> The first patch has been sent before, and is untested, as I have no
> access to the hardware.
> The other patches have been tested on ARAnyM.
>
> Thanks!
>
> Geert Uytterhoeven (3):
>   video: fbdev: atari: Fix TT High video mode
>   video: fbdev: atari: Convert to standard round_up() helper
>   video: fbdev: atari: Remove unused atafb_setcolreg()
>
>  drivers/video/fbdev/atafb.c | 23 +++++------------------
>  1 file changed, 5 insertions(+), 18 deletions(-)

I've applied all 3 patches to the fbdev for-next tree.

Thank you!

Helge

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

* Re: [PATCH 0/3] video: fbdev: atari: Miscellaneous fixes
@ 2022-02-15 20:36   ` Helge Deller
  0 siblings, 0 replies; 10+ messages in thread
From: Helge Deller @ 2022-02-15 20:36 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Michael Schmitz, linux-fbdev, linux-m68k, dri-devel

Hi Geert,

On 2/15/22 12:21, Geert Uytterhoeven wrote:
> This is a small series of miscellaneous fixes for the Atari frame buffer
> device driver.
>
> The first patch has been sent before, and is untested, as I have no
> access to the hardware.
> The other patches have been tested on ARAnyM.
>
> Thanks!
>
> Geert Uytterhoeven (3):
>   video: fbdev: atari: Fix TT High video mode
>   video: fbdev: atari: Convert to standard round_up() helper
>   video: fbdev: atari: Remove unused atafb_setcolreg()
>
>  drivers/video/fbdev/atafb.c | 23 +++++------------------
>  1 file changed, 5 insertions(+), 18 deletions(-)

I've applied all 3 patches to the fbdev for-next tree.

Thank you!

Helge

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

end of thread, other threads:[~2022-02-15 20:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15 11:21 [PATCH 0/3] video: fbdev: atari: Miscellaneous fixes Geert Uytterhoeven
2022-02-15 11:21 ` Geert Uytterhoeven
2022-02-15 11:21 ` [PATCH 1/3] video: fbdev: atari: Fix TT High video mode Geert Uytterhoeven
2022-02-15 11:21   ` Geert Uytterhoeven
2022-02-15 11:21 ` [PATCH 2/3] video: fbdev: atari: Convert to standard round_up() helper Geert Uytterhoeven
2022-02-15 11:21   ` Geert Uytterhoeven
2022-02-15 11:21 ` [PATCH 3/3] video: fbdev: atari: Remove unused atafb_setcolreg() Geert Uytterhoeven
2022-02-15 11:21   ` Geert Uytterhoeven
2022-02-15 20:36 ` [PATCH 0/3] video: fbdev: atari: Miscellaneous fixes Helge Deller
2022-02-15 20:36   ` Helge Deller

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.