Skip to contentSkip to conversation

s3c-fb updates

PATCH New Ben Dooks 4 participants 11 messages May 18, 2010 – May 19, 2010

Subsystems (4)
lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

Updates for the s3c-fb to improbe the build and update support for s5pv210 and s3c2416 devices.

The dependency on Inki Dae's patches have been removed since they've not been reposted, and at-least one causes build failures.

author
#1 lore raw

PATCH 1/5 s3c-fb: Change to depending on CONFIG_S3C_FB_DEV

As suggested by Marek Szyprowski, we should make the driver depend on the configuration currently being used to build the platform device into the kernel.

---
 drivers/video/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/video/Kconfig +1 -1
index 6e16244..a358989 100644
@@ -1914,7 +1914,7 @@ config FB_TMIO_ACCELL
 
 config FB_S3C
 	tristate "Samsung S3C framebuffer support"
-	depends on FB && ARCH_S3C64XX
+	depends on FB && S3C_DEV_FB
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
Signature · 1 line
1.6.3.3
author
#2 lore raw

PATCH 2/5 s3c-fb: only init window colour key controls for windows with blending

In reply to Ben Dooks

The driver clears all windows, but also sets the windows' colour key controls at the same time. However, the last window does not have these registers as it is always blended into the previous window.

Move the colour key initialisation into the probe, and run it for only nr_win-1 windows.

---
 drivers/video/s3c-fb.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
drivers/video/s3c-fb.c +11 -3
index 9682ecc..2403ed3 100644
@@ -844,9 +844,6 @@ static void s3c_fb_clear_win(struct s3c_fb *sfb, int win)
 	void __iomem *regs = sfb->regs;
 
 	writel(0, regs + WINCON(win));
-	writel(0xffffff, regs + WxKEYCONy(win, 0));
-	writel(0xffffff, regs + WxKEYCONy(win, 1));
-
 	writel(0, regs + VIDOSD_A(win));
 	writel(0, regs + VIDOSD_B(win));
 	writel(0, regs + VIDOSD_C(win));
@@ -919,6 +916,12 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev)
 	for (win = 0; win < S3C_FB_MAX_WIN; win++)
 		s3c_fb_clear_win(sfb, win);
 
+	/* initialise colour key controls */
+	for (win = 0; win < (S3C_FB_MAX_WIN - 1); win++) {
+		writel(0xffffff, sfb->regs + WxKEYCONy(win, 0));
+		writel(0xffffff, sfb->regs + WxKEYCONy(win, 1));
+	}
+
 	/* we have the register setup, start allocating framebuffers */
 
 	for (win = 0; win < S3C_FB_MAX_WIN; win++) {
@@ -1019,6 +1022,11 @@ static int s3c_fb_resume(struct platform_device *pdev)
 	for (win_no = 0; win_no < S3C_FB_MAX_WIN; win_no++)
 		s3c_fb_clear_win(sfb, win_no);
 
+	for (win_no = 0; win_no < S3C_FB_MAX_WIN - 1; win_no++) {
+		writel(0xffffff, sfb->regs + WxKEYCONy(win_no, 1));
+		writel(0xffffff, sfb->regs + WxKEYCONy(win_no, 1));
+	}
+
 	/* restore framebuffers */
 	for (win_no = 0; win_no < S3C_FB_MAX_WIN; win_no++) {
 		win = sfb->windows[win_no];
Signature · 1 line
1.6.3.3
author
#3 lore raw

PATCH 3/5 s3c-fb: Initial move to unifying the header files

In reply to Ben Dooks

Remove the various header files that configure this driver and use the platform device name to select the correct configuration at probe time.

Currently this does not remove the header files, only updates the driver and the relevant platform files.

---
 arch/arm/mach-s3c64xx/include/mach/regs-fb.h    |   20 ---
 arch/arm/mach-s5pc100/include/mach/regs-fb.h    |   34 ----
 arch/arm/plat-samsung/include/plat/regs-fb-v4.h |   36 ----
 drivers/video/s3c-fb.c                          |  208 ++++++++++++++++++++---
 4 files changed, 180 insertions(+), 118 deletions(-)
arch/arm/mach-s3c64xx/include/mach/regs-fb.h +0 -20
index f566115..a06ee0a 100644
@@ -18,24 +18,4 @@
 
 #include <plat/regs-fb-v4.h>
 
-/* Palette registers */
-#define WIN2_PAL(_entry)			(0x300 + ((_entry) * 2))
-#define WIN3_PAL(_entry)			(0x320 + ((_entry) * 2))
-#define WIN4_PAL(_entry)			(0x340 + ((_entry) * 2))
-#define WIN0_PAL(_entry)			(0x400 + ((_entry) * 4))
-#define WIN1_PAL(_entry)			(0x800 + ((_entry) * 4))
-
-static inline unsigned int s3c_fb_pal_reg(unsigned int window, int reg)
-{
-	switch (window) {
-	case 0: return WIN0_PAL(reg);
-	case 1: return WIN1_PAL(reg);
-	case 2: return WIN2_PAL(reg);
-	case 3: return WIN3_PAL(reg);
-	case 4: return WIN4_PAL(reg);
-	}
-
-	BUG();
-}
-
 #endif /* __ASM_ARCH_MACH_REGS_FB_H */
arch/arm/mach-s5pc100/include/mach/regs-fb.h +0 -34
index 1732cd2..4be4cc9 100644
@@ -100,40 +100,6 @@
 #define BLENDCON					(0x260)
 #define BLENDCON_8BIT_ALPHA				(1 << 0)
 
-/* Per-window palette base addresses (start of palette memory).
- * Each window palette area consists of 256 32-bit entries.
- * START is the first address (entry 0th), END is the address of 255th entry.
- */
-#define WIN0_PAL_BASE					(0x2400)
-#define WIN0_PAL_END					(0x27fc)
-#define WIN1_PAL_BASE					(0x2800)
-#define WIN1_PAL_END					(0x2bfc)
-#define WIN2_PAL_BASE					(0x2c00)
-#define WIN2_PAL_END					(0x2ffc)
-#define WIN3_PAL_BASE					(0x3000)
-#define WIN3_PAL_END					(0x33fc)
-#define WIN4_PAL_BASE					(0x3400)
-#define WIN4_PAL_END					(0x37fc)
-
-#define WIN0_PAL(_entry)			(WIN0_PAL_BASE + ((_entry) * 4))
-#define WIN1_PAL(_entry)			(WIN1_PAL_BASE + ((_entry) * 4))
-#define WIN2_PAL(_entry)			(WIN2_PAL_BASE + ((_entry) * 4))
-#define WIN3_PAL(_entry)			(WIN3_PAL_BASE + ((_entry) * 4))
-#define WIN4_PAL(_entry)			(WIN4_PAL_BASE + ((_entry) * 4))
-
-static inline unsigned int s3c_fb_pal_reg(unsigned int window, int reg)
-{
-	switch (window) {
-	case 0: return WIN0_PAL(reg);
-	case 1: return WIN1_PAL(reg);
-	case 2: return WIN2_PAL(reg);
-	case 3: return WIN3_PAL(reg);
-	case 4: return WIN4_PAL(reg);
-	}
-
-	BUG();
-}
-
 
 #endif /* __ASM_ARCH_REGS_FB_H */
 
arch/arm/plat-samsung/include/plat/regs-fb-v4.h +0 -36
index 0f43599..0477e8a 100644
@@ -148,42 +148,6 @@
  * compiled.
 */
 
-/* return true if window _win has OSD register D */
-#define s3c_fb_has_osd_d(_win) ((_win) != 4 && (_win) != 0)
-
-static inline unsigned int s3c_fb_win_pal_size(unsigned int win)
-{
-	if (win < 2)
-		return 256;
-	if (win < 4)
-		return 16;
-	if (win == 4)
-		return 4;
-
-	BUG();	/* shouldn't get here */
-}
-
-static inline int s3c_fb_validate_win_bpp(unsigned int win, unsigned int bpp)
-{
-	/* all windows can do 1/2 bpp */
-
-	if ((bpp == 25 || bpp == 19) && win == 0)
-		return 0;	/* win 0 does not have 19 or 25bpp modes */
-
-	if (bpp == 4 && win == 4)
-		return 0;
-
-	if (bpp == 8 && (win >= 3))
-		return 0;	/* win 3/4 cannot do 8bpp in any mode */
-
-	return 1;
-}
-
-static inline int s3c_fb_pal_is16(unsigned int window)
-{
-	return window > 1;
-}
-
 struct s3c_fb_palette {
 	struct fb_bitfield	r;
 	struct fb_bitfield	g;
drivers/video/s3c-fb.c +180 -28

385 lines not on this page · raw message

Signature · 1 line
1.6.3.3
author
#4 lore raw

PATCH 4/5 s3c-fb: udpate to support s3c2416/s3c2443 style hardware

In reply to Ben Dooks

Update the variant and window variant structures with the necessary changes to support the older style of hardware where these are not in the same place.

Add the support for the s3c2443/s3c2416 hardware by using the platform-device s3c2443 to cover both, and add the initialisation data for these.

Also change to including just the v4 header files for the moment until the last of the merging of these is sorted out.

---
 arch/arm/plat-samsung/include/plat/regs-fb-v4.h |    8 +-
 arch/arm/plat-samsung/include/plat/regs-fb.h    |    4 +
 drivers/video/s3c-fb.c                          |  162 ++++++++++++++++++-----
 3 files changed, 136 insertions(+), 38 deletions(-)
arch/arm/plat-samsung/include/plat/regs-fb-v4.h +1 -7
index 0477e8a..8352f5d 100644
@@ -40,16 +40,10 @@
 
 /* OSD1 and OSD4 do not have register D */
 
-#define VIDOSD_A(_win)				(0x40 + ((_win) * 16))
-#define VIDOSD_B(_win)				(0x44 + ((_win) * 16))
-#define VIDOSD_C(_win)				(0x48 + ((_win) * 16))
-#define VIDOSD_D(_win)				(0x4C + ((_win) * 16))
-
+#define VIDOSD_BASE				(0x40)
 
 #define VIDINTCON0				(0x130)
 
-#define WxKEYCONy(_win, _con)			((0x140 + ((_win) * 8)) + ((_con) * 4))
-
 /* WINCONx */
 
 #define WINCONx_CSCWIDTH_MASK			(0x3 << 26)
arch/arm/plat-samsung/include/plat/regs-fb.h +4 -0
index 0ef806e..73d1aae 100644
@@ -321,6 +321,10 @@
 #define VIDINTCON1_INT_FIFO			(1 << 0)
 
 /* Window colour-key control registers */
+#define WKEYCON					(0x140)	/* 6410,V210 */
+
+#define WKEYCON0				(0x00)
+#define WKEYCON1				(0x04)
 
 #define WxKEYCON0_KEYBL_EN			(1 << 26)
 #define WxKEYCON0_KEYEN_F			(1 << 25)
drivers/video/s3c-fb.c +131 -31

330 lines not on this page · raw message

Signature · 1 line
1.6.3.3
author
#5 lore raw

PATCH 5/5 s3c-fb: Integrate palette setup code into main driver

In reply to Ben Dooks

Remove the palette setup code from the header files and put it into the main driver.

---
 arch/arm/plat-samsung/include/plat/regs-fb-v4.h |   34 -----------------------
 drivers/video/s3c-fb.c                          |   33 +++++++++++++++++++++-
 2 files changed, 32 insertions(+), 35 deletions(-)
arch/arm/plat-samsung/include/plat/regs-fb-v4.h +0 -34
index 8352f5d..4c3647f 100644
@@ -137,40 +137,6 @@
 #define WPALCON_W2PAL_16BPP_A555		(1 << 6)
 
 
-/* system specific implementation code for palette sizes, and other
- * information that changes depending on which architecture is being
- * compiled.
-*/
-
-struct s3c_fb_palette {
-	struct fb_bitfield	r;
-	struct fb_bitfield	g;
-	struct fb_bitfield	b;
-	struct fb_bitfield	a;
-};
-
-static inline void s3c_fb_init_palette(unsigned int window,
-				       struct s3c_fb_palette *palette)
-{
-	if (window < 2) {
-		/* Windows 0/1 are 8/8/8 or A/8/8/8 */
-		palette->r.offset = 16;
-		palette->r.length = 8;
-		palette->g.offset = 8;
-		palette->g.length = 8;
-		palette->b.offset = 0;
-		palette->b.length = 8;
-	} else {
-		/* currently we assume RGB 5/6/5 */
-		palette->r.offset = 11;
-		palette->r.length = 5;
-		palette->g.offset = 5;
-		palette->g.length = 6;
-		palette->b.offset = 0;
-		palette->b.length = 5;
-	}
-}
-
 /* Notes on per-window bpp settings
  *
  * Value	Win0	 Win1	  Win2	   Win3	    Win 4
drivers/video/s3c-fb.c +32 -1
index 8b49ea7..b9907b9 100644
@@ -116,6 +116,20 @@ struct s3c_fb_driverdata {
 };
 
 /**
+ * struct s3c_fb_palette - palette information
+ * @r: Red bitfield.
+ * @g: Green bitfield.
+ * @b: Blue bitfield.
+ * @a: Alpha bitfield.
+ */
+struct s3c_fb_palette {
+	struct fb_bitfield	r;
+	struct fb_bitfield	g;
+	struct fb_bitfield	b;
+	struct fb_bitfield	a;
+};
+
+/**
  * struct s3c_fb_win - per window private data for each framebuffer.
  * @windata: The platform data supplied for the window configuration.
  * @parent: The hardware that this window is part of.
@@ -865,7 +879,24 @@ static int __devinit s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
 	}
 
 	/* setup the r/b/g positions for the window's palette */
-	s3c_fb_init_palette(win_no, &win->palette);
+	if (win->variant.palette_16bpp) {
+		/* Set RGB 5:6:5 as default */
+		win->palette.r.offset = 11;
+		win->palette.r.length = 5;
+		win->palette.g.offset = 5;
+		win->palette.g.length = 6;
+		win->palette.b.offset = 0;
+		win->palette.b.length = 5;
+
+	} else {
+		/* Set 8bpp or 8bpp and 1bit alpha */
+		win->palette.r.offset = 16;
+		win->palette.r.length = 8;
+		win->palette.g.offset = 8;
+		win->palette.g.length = 8;
+		win->palette.b.offset = 0;
+		win->palette.b.length = 8;
+	}
 
 	/* setup the initial video mode from the window */
 	fb_videomode_to_var(&fbinfo->var, initmode);
Signature · 1 line
1.6.3.3
#6 lore raw
In reply to Ben Dooks

Hi,

Quoted 5 lines · Ben Dooks

Updates for the s3c-fb to improbe the build and update support for s5pv210 and s3c2416 devices.

The dependency on Inki Dae's patches have been removed since they've not been reposted, and at-least one causes build failures.

Ben please check your mailbox again. He sent it after your reply.

Anyway, how do you integrate the FIMD and FIMC features in current driver? Any plans?

Thank you,
Kyungmin Park

author
#7 lore raw
Quoted 10 lines · Kyungmin Park

Hi,

Quoted 5 lines · Ben Dooks

Updates for the s3c-fb to improbe the build and update support for s5pv210 and s3c2416 devices.

The dependency on Inki Dae's patches have been removed since they've not been reposted, and at-least one causes build failures.

Ben please check your mailbox again. He sent it after your reply.

no, what he sent was three patch files attached to a mail[1] which Andrew Morton replied to saying that these needed to be sent as proper patches with descriptions and other such things that patches have.

Quoted 2 lines

Anyway, how do you integrate the FIMD and FIMC features in current driver? Any plans?

I've been discussiong things with the engineers here. However, the first thing is to get the driver closer aligned to the one that Sys.LSI have been shipping, which means getting some missing features sorted out.

By the way, which is the FIMC block? I've not seen any documentation referencing this as an block in the SoC.

As such I will try and see if Pawel's previous patcehs that got missed can be merged into this tree and into the kernel this round.

[1] http://lkml.org/lkml/2010/5/7/63

Signature · 4 lines
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
#8 lore raw

Hi, Ben

I sent patch series corrected as Andrew requested yesterday. I was busy so I conformed your answer late.

Sorry but please review my patch series again.

thank you.

2010/5/19 Ben Dooks <[email protected]>:

Quoted 43 lines · Kyungmin Park
Quoted 10 lines

Hi,

Quoted 5 lines · Ben Dooks

Updates for the s3c-fb to improbe the build and update support for s5pv210 and s3c2416 devices.

The dependency on Inki Dae's patches have been removed since they've not been reposted, and at-least one causes build failures.

Ben please check your mailbox again. He sent it after your reply.

no, what he sent was three patch files attached to a mail[1] which Andrew Morton replied to saying that these needed to be sent as proper patches with descriptions and other such things that patches have.

Quoted 2 lines

Anyway, how do you integrate the FIMD and FIMC features in current driver? Any plans?

I've been discussiong things with the engineers here. However, the first thing is to get the driver closer aligned to the one that Sys.LSI have been shipping, which means getting some missing features sorted out.

By the way, which is the FIMC block? I've not seen any documentation referencing this as an block in the SoC.

As such I will try and see if Pawel's previous patcehs that got missed can be merged into this tree and into the kernel this round.

[1] http://lkml.org/lkml/2010/5/7/63

--
Ben

Q: ? ? ?What's a light-year?
A: ? ? ?One-third less calories than a regular year.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

author
#9 lore raw
Quoted 6 lines · InKi Dae

Hi, Ben

I sent patch series corrected as Andrew requested yesterday. I was busy so I conformed your answer late.

Sorry but please review my patch series again.

I've merged the 24/32BPP fix onto my tree and the window selection, the S5PV210 shadowcon stuff is pending partly due to the fact it breaks the build on the old hardware and secondly I'd like to put that after the current work on multi-hardware support that was done for the s3c2443.

I've updated git.fluff.org's dev/s3c-fb branch which these and rebased it onto the first pull set for mainline.

Signature · 4 lines
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
#10 lore raw
In reply to Ben Dooks
Quoted 19 lines · Ben Dooks
Quoted 10 lines · Kyungmin Park

Hi,

Quoted 5 lines · Ben Dooks

Updates for the s3c-fb to improbe the build and update support for s5pv210 and s3c2416 devices.

The dependency on Inki Dae's patches have been removed since they've not been reposted, and at-least one causes build failures.

Ben please check your mailbox again. He sent it after your reply.

no, what he sent was three patch files attached to a mail[1] which Andrew Morton replied to saying that these needed to be sent as proper patches with descriptions and other such things that patches have.

Quoted 2 lines

Anyway, how do you integrate the FIMD and FIMC features in current driver? Any plans?

Quoted 6 lines

I've been discussiong things with the engineers here. However, the first thing is to get the driver closer aligned to the one that Sys.LSI have been shipping, which means getting some missing features sorted out.

By the way, which is the FIMC block? I've not seen any documentation referencing this as an block in the SoC.

FIMC is a camera interface block. It can output video stream directly to display controller FIFO.

Signature · 5 lines
Yauhen Kharuzhy		jekhor _at_ gmail.com
			JID: jek at jabber.ru

A: No
Q: Should I quote below my post?