Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH 4/5] viafb: fix IGA1 modesetting on VX900
From: Florian Tobias Schandinat @ 2012-02-22 18:53 UTC (permalink / raw)
  To: linux-fbdev; +Cc: linux-kernel, Florian Tobias Schandinat, stable
In-Reply-To: <cover.1329936280.git.FlorianSchandinat@gmx.de>

Even if the documentation calls this bit "Reserved" it has to be set
to 0 for correct modesetting on IGA1.

Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: stable@vger.kernel.org
---
 drivers/video/via/hw.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index e6e7a8f..376af05 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -1804,6 +1804,9 @@ static void hw_init(void)
 		break;
 	}
 
+	/* magic required on VX900 for correct modesetting on IGA1 */
+	via_write_reg_mask(VIACR, 0x45, 0x00, 0x01);
+
 	/* probably this should go to the scaling code one day */
 	via_write_reg_mask(VIACR, 0xFD, 0, 0x80); /* VX900 hw scale on IGA2 */
 	viafb_write_regx(scaling_parameters, ARRAY_SIZE(scaling_parameters));
-- 
1.7.9


^ permalink raw reply related

* [PATCH 5/5] viafb: LCD bpp cleanup
From: Florian Tobias Schandinat @ 2012-02-22 18:53 UTC (permalink / raw)
  To: linux-fbdev; +Cc: linux-kernel, Florian Tobias Schandinat
In-Reply-To: <cover.1329936280.git.FlorianSchandinat@gmx.de>

This patch removes redundant bits per pixel information by using the
one storged in var directly. Simplifies code without any functional
changes.

Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
---
 drivers/video/via/chip.h     |    1 -
 drivers/video/via/hw.c       |   16 ++--------------
 drivers/video/via/hw.h       |    2 +-
 drivers/video/via/lcd.c      |   21 ++++++++-------------
 drivers/video/via/viafbdev.c |    2 +-
 5 files changed, 12 insertions(+), 30 deletions(-)

diff --git a/drivers/video/via/chip.h b/drivers/video/via/chip.h
index c2ecdb5..d32a507 100644
--- a/drivers/video/via/chip.h
+++ b/drivers/video/via/chip.h
@@ -146,7 +146,6 @@ struct tmds_setting_information {
 
 struct lvds_setting_information {
 	int iga_path;
-	int bpp;
 	int lcd_panel_hres;
 	int lcd_panel_vres;
 	int display_method;
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index 376af05..411b7e9 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -1529,9 +1529,6 @@ void viafb_update_device_setting(int hres, int vres, int bpp, int flag)
 	if (flag = 0) {
 		viaparinfo->tmds_setting_info->h_active = hres;
 		viaparinfo->tmds_setting_info->v_active = vres;
-
-		viaparinfo->lvds_setting_info->bpp = bpp;
-		viaparinfo->lvds_setting_info2->bpp = bpp;
 	} else {
 
 		if (viaparinfo->tmds_setting_info->iga_path = IGA2) {
@@ -1539,11 +1536,6 @@ void viafb_update_device_setting(int hres, int vres, int bpp, int flag)
 			viaparinfo->tmds_setting_info->v_active = vres;
 		}
 
-		if (viaparinfo->lvds_setting_info->iga_path = IGA2)
-			viaparinfo->lvds_setting_info->bpp = bpp;
-
-		if (IGA2 = viaparinfo->lvds_setting_info2->iga_path)
-			viaparinfo->lvds_setting_info2->bpp = bpp;
 	}
 }
 
@@ -1838,7 +1830,7 @@ static void hw_init(void)
 	load_fix_bit_crtc_reg();
 }
 
-int viafb_setmode(int video_bpp, int video_bpp1)
+int viafb_setmode(void)
 {
 	int j, cxres = 0, cyres = 0;
 	int port;
@@ -1927,7 +1919,6 @@ int viafb_setmode(int video_bpp, int video_bpp1)
 	if (viafb_LCD_ON) {
 		if (viafb_SAMM_ON &&
 			(viaparinfo->lvds_setting_info->iga_path = IGA2)) {
-			viaparinfo->lvds_setting_info->bpp = video_bpp1;
 			viafb_lcd_set_mode(&var2, cxres, cyres,
 				viaparinfo->lvds_setting_info,
 				&viaparinfo->chip_info->lvds_chip_info);
@@ -1937,7 +1928,6 @@ int viafb_setmode(int video_bpp, int video_bpp1)
 				viaparinfo->lvds_setting_info->display_method  				    LCD_CENTERING;
 			}
-			viaparinfo->lvds_setting_info->bpp = video_bpp;
 			viafb_lcd_set_mode(&viafbinfo->var, 0, 0,
 				viaparinfo->lvds_setting_info,
 				&viaparinfo->chip_info->lvds_chip_info);
@@ -1946,7 +1936,6 @@ int viafb_setmode(int video_bpp, int video_bpp1)
 	if (viafb_LCD2_ON) {
 		if (viafb_SAMM_ON &&
 			(viaparinfo->lvds_setting_info2->iga_path = IGA2)) {
-			viaparinfo->lvds_setting_info2->bpp = video_bpp1;
 			viafb_lcd_set_mode(&var2, cxres, cyres,
 				viaparinfo->lvds_setting_info2,
 				&viaparinfo->chip_info->lvds_chip_info2);
@@ -1956,7 +1945,6 @@ int viafb_setmode(int video_bpp, int video_bpp1)
 				viaparinfo->lvds_setting_info2->display_method  				    LCD_CENTERING;
 			}
-			viaparinfo->lvds_setting_info2->bpp = video_bpp;
 			viafb_lcd_set_mode(&viafbinfo->var, 0, 0,
 				viaparinfo->lvds_setting_info2,
 				&viaparinfo->chip_info->lvds_chip_info2);
@@ -1971,7 +1959,7 @@ int viafb_setmode(int video_bpp, int video_bpp1)
 	if (!viafb_hotplug) {
 		viafb_hotplug_Xres = viafbinfo->var.xres;
 		viafb_hotplug_Yres = viafbinfo->var.yres;
-		viafb_hotplug_bpp = video_bpp;
+		viafb_hotplug_bpp = viafbinfo->var.bits_per_pixel;
 		viafb_hotplug_refresh = viafb_refresh;
 
 		if (viafb_DVI_ON)
diff --git a/drivers/video/via/hw.h b/drivers/video/via/hw.h
index f8129e4..cacedc1 100644
--- a/drivers/video/via/hw.h
+++ b/drivers/video/via/hw.h
@@ -658,7 +658,7 @@ void viafb_load_FIFO_reg(int set_iga, int hor_active, int ver_active);
 void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\
 					*p_gfx_dpa_setting);
 
-int viafb_setmode(int video_bpp, int video_bpp1);
+int viafb_setmode(void);
 void viafb_fill_var_timing_info(struct fb_var_screeninfo *var,
 	struct crt_mode_table *mode);
 void __devinit viafb_init_chip_info(int chip_type);
diff --git a/drivers/video/via/lcd.c b/drivers/video/via/lcd.c
index 02cfdc8..6e52711 100644
--- a/drivers/video/via/lcd.c
+++ b/drivers/video/via/lcd.c
@@ -53,9 +53,6 @@ static void __devinit fp_id_to_vindex(int panel_id);
 static int lvds_register_read(int index);
 static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres,
 		      int panel_vres);
-static void via_pitch_alignment_patch_lcd(
-	struct lvds_setting_information *plvds_setting_info,
-	struct lvds_chip_information *plvds_chip_info, int hres);
 static void lcd_patch_skew_dvp0(struct lvds_setting_information
 			 *plvds_setting_info,
 			 struct lvds_chip_information *plvds_chip_info);
@@ -453,19 +450,17 @@ static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres,
 	}
 }
 
-static void via_pitch_alignment_patch_lcd(
-	struct lvds_setting_information *plvds_setting_info,
-	struct lvds_chip_information *plvds_chip_info, int hres)
+static void via_pitch_alignment_patch_lcd(int iga_path, int hres, int bpp)
 {
 	unsigned char cr13, cr35, cr65, cr66, cr67;
 	unsigned long dwScreenPitch = 0;
 	unsigned long dwPitch;
 
-	dwPitch = hres * (plvds_setting_info->bpp >> 3);
+	dwPitch = hres * (bpp >> 3);
 	if (dwPitch & 0x1F) {
 		dwScreenPitch = ((dwPitch + 31) & ~31) >> 3;
-		if (plvds_setting_info->iga_path = IGA2) {
-			if (plvds_setting_info->bpp > 8) {
+		if (iga_path = IGA2) {
+			if (bpp > 8) {
 				cr66 = (unsigned char)(dwScreenPitch & 0xFF);
 				viafb_write_reg(CR66, VIACR, cr66);
 				cr67 = viafb_read_reg(VIACR, CR67) & 0xFC;
@@ -483,7 +478,7 @@ static void via_pitch_alignment_patch_lcd(
 			cr65 += 2;
 			viafb_write_reg(CR65, VIACR, cr65);
 		} else {
-			if (plvds_setting_info->bpp > 8) {
+			if (bpp > 8) {
 				cr13 = (unsigned char)(dwScreenPitch & 0xFF);
 				viafb_write_reg(CR13, VIACR, cr13);
 				cr35 = viafb_read_reg(VIACR, CR35) & 0x1F;
@@ -551,7 +546,7 @@ void viafb_lcd_set_mode(const struct fb_var_screeninfo *var, u16 cxres,
 	struct lvds_chip_information *plvds_chip_info)
 {
 	int set_iga = plvds_setting_info->iga_path;
-	int mode_bpp = plvds_setting_info->bpp;
+	int mode_bpp = var->bits_per_pixel;
 	int set_hres = cxres ? cxres : var->xres;
 	int set_vres = cyres ? cyres : var->yres;
 	int panel_hres = plvds_setting_info->lcd_panel_hres;
@@ -612,8 +607,8 @@ void viafb_lcd_set_mode(const struct fb_var_screeninfo *var, u16 cxres,
 		viafb_write_reg_mask(CR6A, VIACR, 0x01, BIT0);
 
 	/* Patch for non 32bit alignment mode */
-	via_pitch_alignment_patch_lcd(plvds_setting_info, plvds_chip_info,
-		set_hres);
+	via_pitch_alignment_patch_lcd(plvds_setting_info->iga_path, set_hres,
+		var->bits_per_pixel);
 }
 
 static void integrated_lvds_disable(struct lvds_setting_information
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 9cfa92e..7529340 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -303,7 +303,7 @@ static int viafb_set_par(struct fb_info *info)
 			info->flags &= ~FBINFO_HWACCEL_DISABLED;
 		else
 			info->flags |= FBINFO_HWACCEL_DISABLED;
-		viafb_setmode(info->var.bits_per_pixel, viafb_bpp1);
+		viafb_setmode();
 		viafb_pan_display(&info->var, info);
 	}
 
-- 
1.7.9


^ permalink raw reply related

* Re: [PATCH 8/8] ARM: OMAP2+: Limit omap_read/write usage to legacy USB drivers
From: Tony Lindgren @ 2012-02-22 18:57 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1329898441.2070.10.camel@deskari>

* Tomi Valkeinen <tomi.valkeinen@ti.com> [120221 23:42]:
> On Tue, 2012-02-21 at 15:40 -0800, Tony Lindgren wrote:
> > Drivers should no longer use omap_read/write functions
> > but instead use ioremap + read/write functions.
> > 
> > As some USB legacy code is still shared between omap1 and
> > omap2420, let's limit the omap_read/write to plat/usb.h.
> > 
> > Also, let's make drivers/video/omap/lcdc.c depend on
> > ARCH_OMAP1 as it is not needed for omap2+.
> 
> I'm ok with the lcdc.c change, but I also have a patch series that makes
> the same change, plus removes the omap2 code from drivers/video/omap/.

OK, I'll drop the lcdc.c change from my series as that should
only affect randconfig builds.
 
> Can you check the series, and give ack if the arch/arm side looks fine?
> It's this one: [PATCH 00/16] OMAPDSS: old OMAPFB cleanup

Yeah great, I've acked those. Let's do a test merge when I
have these in cleanup branch, looks like the conflicts should
be trivial.

Tony

^ permalink raw reply

* Re: [PATCH 1/8] ARM: OMAP2+: Move DISPC L3 firewall to happen in omap_display_init()
From: Tony Lindgren @ 2012-02-22 19:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1329898191.2070.6.camel@deskari>

* Tomi Valkeinen <tomi.valkeinen@ti.com> [120221 23:38]:
> Hi,
> 
> On Tue, 2012-02-21 at 15:40 -0800, Tony Lindgren wrote:
> > Otherwise we cannot move most of plat/io.h to be a local
> > iomap.h for mach-omap2.
> > 
> > Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> > Cc: linux-fbdev@vger.kernel.org
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > ---
> >  arch/arm/mach-omap2/display.c   |    3 +++
> >  drivers/video/omap2/dss/dispc.c |    5 -----
> >  2 files changed, 3 insertions(+), 5 deletions(-)
> > 
> > diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
> > index 3677b1f..5a7f12f 100644
> > --- a/arch/arm/mach-omap2/display.c
> > +++ b/arch/arm/mach-omap2/display.c
> > @@ -191,6 +191,9 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
> >  	memset(&pdata, 0, sizeof(pdata));
> >  
> >  	if (cpu_is_omap24xx()) {
> > +		/* L3 firewall setting: enable access to OCM RAM */
> > +		__raw_writel(0x402000b0, OMAP2_L3_IO_ADDRESS(0x680050a0));
> > +
> >  		curr_dss_hwmod = omap2_dss_hwmod_data;
> >  		oh_count = ARRAY_SIZE(omap2_dss_hwmod_data);
> >  	} else if (cpu_is_omap34xx()) {
> > diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> > index e1626a1..cce0820 100644
> > --- a/drivers/video/omap2/dss/dispc.c
> > +++ b/drivers/video/omap2/dss/dispc.c
> > @@ -3272,11 +3272,6 @@ static void _omap_dispc_initial_config(void)
> >  	if (dss_has_feature(FEAT_FUNCGATED))
> >  		REG_FLD_MOD(DISPC_CONFIG, 1, 9, 9);
> >  
> > -	/* L3 firewall setting: enable access to OCM RAM */
> > -	/* XXX this should be somewhere in plat-omap */
> > -	if (cpu_is_omap24xx())
> > -		__raw_writel(0x402000b0, OMAP2_L3_IO_ADDRESS(0x680050a0));
> > -
> >  	_dispc_setup_color_conv_coef();
> >  
> >  	dispc_set_loadmode(OMAP_DSS_LOAD_FRAME_ONLY);
> > 
> 
> I think the whole raw_writel line can be removed. It's been copied from
> the old omapfb, and my understanding is that it's about using SRAM for
> framebuffer. Using SRAM for fb is no longer supported, and I have a
> patch set that removes the remaining SRAM code from omapfb/omapdss.

OK, I'll remove those from drivers/video/omap2/dss/dispc.c so this
series keeps building.

Tony

^ permalink raw reply

* Re: [PATCH 00/16] OMAPDSS: old OMAPFB cleanup
From: Tony Lindgren @ 2012-02-22 22:09 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-fbdev, archit, linux-omap
In-Reply-To: <20120222185016.GI18185@atomide.com>

* Tony Lindgren <tony@atomide.com> [120222 10:18]:
> * Tomi Valkeinen <tomi.valkeinen@ti.com> [120214 03:21]:
> > 
> > Tony, do you have any feedback on this? I think the arch/arm changes are
> > quite clean as such, but are you ok with (possibly) breaking N770's
> > display? The other OMAP1 boards should, at least in theory, work as well
> > as before.
> > 
> > For N770, the bootloader passes the reset GPIO number and number of
> > datalines, and I have no idea what those are.
> 
> I think they should be:
> 
> conf->nreset_gpio = 13
> conf->data_lines = 24

Probably should be:

conf->nreset_gpio = 13
conf->data_lines = 16

No luck getting anything on the LCD though with
current kernel though.

Tony

^ permalink raw reply

* Re: [PATCH 1/8] ARM: OMAP2+: Move DISPC L3 firewall to happen in omap_display_init()
From: Tony Lindgren @ 2012-02-22 22:17 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20120222190531.GK18185@atomide.com>

* Tony Lindgren <tony@atomide.com> [120222 10:34]:
> * Tomi Valkeinen <tomi.valkeinen@ti.com> [120221 23:38]:
> > Hi,
> > 
> > On Tue, 2012-02-21 at 15:40 -0800, Tony Lindgren wrote:
> > > Otherwise we cannot move most of plat/io.h to be a local
> > > iomap.h for mach-omap2.
> > > 
> > > Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> > > Cc: linux-fbdev@vger.kernel.org
> > > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > > ---
> > >  arch/arm/mach-omap2/display.c   |    3 +++
> > >  drivers/video/omap2/dss/dispc.c |    5 -----
> > >  2 files changed, 3 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
> > > index 3677b1f..5a7f12f 100644
> > > --- a/arch/arm/mach-omap2/display.c
> > > +++ b/arch/arm/mach-omap2/display.c
> > > @@ -191,6 +191,9 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
> > >  	memset(&pdata, 0, sizeof(pdata));
> > >  
> > >  	if (cpu_is_omap24xx()) {
> > > +		/* L3 firewall setting: enable access to OCM RAM */
> > > +		__raw_writel(0x402000b0, OMAP2_L3_IO_ADDRESS(0x680050a0));
> > > +
> > >  		curr_dss_hwmod = omap2_dss_hwmod_data;
> > >  		oh_count = ARRAY_SIZE(omap2_dss_hwmod_data);
> > >  	} else if (cpu_is_omap34xx()) {
> > > diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> > > index e1626a1..cce0820 100644
> > > --- a/drivers/video/omap2/dss/dispc.c
> > > +++ b/drivers/video/omap2/dss/dispc.c
> > > @@ -3272,11 +3272,6 @@ static void _omap_dispc_initial_config(void)
> > >  	if (dss_has_feature(FEAT_FUNCGATED))
> > >  		REG_FLD_MOD(DISPC_CONFIG, 1, 9, 9);
> > >  
> > > -	/* L3 firewall setting: enable access to OCM RAM */
> > > -	/* XXX this should be somewhere in plat-omap */
> > > -	if (cpu_is_omap24xx())
> > > -		__raw_writel(0x402000b0, OMAP2_L3_IO_ADDRESS(0x680050a0));
> > > -
> > >  	_dispc_setup_color_conv_coef();
> > >  
> > >  	dispc_set_loadmode(OMAP_DSS_LOAD_FRAME_ONLY);
> > > 
> > 
> > I think the whole raw_writel line can be removed. It's been copied from
> > the old omapfb, and my understanding is that it's about using SRAM for
> > framebuffer. Using SRAM for fb is no longer supported, and I have a
> > patch set that removes the remaining SRAM code from omapfb/omapdss.
> 
> OK, I'll remove those from drivers/video/omap2/dss/dispc.c so this
> series keeps building.

Here's this one updated.

Tony


From: Tony Lindgren <tony@atomide.com>
Date: Mon, 20 Feb 2012 12:55:07 -0800
Subject: [PATCH] ARM: OMAP2+: Drop DISPC L3 firewall code

This is only needed when using SRAM for framebuffer,
and the support for SRAM framebuffer is about to get
removed.

Otherwise we cannot move most of plat/io.h to be a local
iomap.h for mach-omap2.

Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-fbdev@vger.kernel.org
Signed-off-by: Tony Lindgren <tony@atomide.com>

--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3272,11 +3272,6 @@ static void _omap_dispc_initial_config(void)
 	if (dss_has_feature(FEAT_FUNCGATED))
 		REG_FLD_MOD(DISPC_CONFIG, 1, 9, 9);
 
-	/* L3 firewall setting: enable access to OCM RAM */
-	/* XXX this should be somewhere in plat-omap */
-	if (cpu_is_omap24xx())
-		__raw_writel(0x402000b0, OMAP2_L3_IO_ADDRESS(0x680050a0));
-
 	_dispc_setup_color_conv_coef();
 
 	dispc_set_loadmode(OMAP_DSS_LOAD_FRAME_ONLY);

^ permalink raw reply

* Re: [PATCH 8/8] ARM: OMAP2+: Limit omap_read/write usage to legacy USB drivers
From: Tony Lindgren @ 2012-02-22 22:44 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20120222185728.GJ18185@atomide.com>

* Tony Lindgren <tony@atomide.com> [120222 10:27]:
> * Tomi Valkeinen <tomi.valkeinen@ti.com> [120221 23:42]:
> > On Tue, 2012-02-21 at 15:40 -0800, Tony Lindgren wrote:
> > > Drivers should no longer use omap_read/write functions
> > > but instead use ioremap + read/write functions.
> > > 
> > > As some USB legacy code is still shared between omap1 and
> > > omap2420, let's limit the omap_read/write to plat/usb.h.
> > > 
> > > Also, let's make drivers/video/omap/lcdc.c depend on
> > > ARCH_OMAP1 as it is not needed for omap2+.
> > 
> > I'm ok with the lcdc.c change, but I also have a patch series that makes
> > the same change, plus removes the omap2 code from drivers/video/omap/.
> 
> OK, I'll drop the lcdc.c change from my series as that should
> only affect randconfig builds.

Here's this one updated. Noticed one more legacy driver
that needs omap_read/write defined to build on 2420.

Regards,

Tony


Date: Tue, 21 Feb 2012 13:27:33 -0800
Subject: [PATCH] ARM: OMAP2+: Limit omap_read/write usage to legacy USB drivers

Drivers should no longer use omap_read/write functions
but instead use ioremap + read/write functions.

As some USB legacy code is still shared between omap1 and
omap2420, let's limit the omap_read/write to plat/usb.h.

Note that the long term fix is to update the drivers to
use ioremap and read/write functions. That can now be
done as a separate patch series that is limited to the
USB drivers.

Also make sure the legacy omap1-keypad.c driver builds
if selected for 2420 based systems.

Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 09ca9e9..f78ec4e 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -242,15 +242,5 @@ struct omap_sdrc_params;
 extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
 				      struct omap_sdrc_params *sdrc_cs1);
 
-/*
- * NOTE: Please use ioremap + __raw_read/write where possible instead of these
- */
-extern u8 omap_readb(u32 pa);
-extern u16 omap_readw(u32 pa);
-extern u32 omap_readl(u32 pa);
-extern void omap_writeb(u8 v, u32 pa);
-extern void omap_writew(u16 v, u32 pa);
-extern void omap_writel(u32 v, u32 pa);
-
 #endif /* __ASSEMBLER__ */
 #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 0119807..3203128 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -487,43 +487,3 @@ void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
 		_omap2_init_reprogram_sdrc();
 	}
 }
-
-/*
- * NOTE: Please use ioremap + __raw_read/write where possible instead of these
- */
-
-u8 omap_readb(u32 pa)
-{
-	return __raw_readb(OMAP2_L4_IO_ADDRESS(pa));
-}
-EXPORT_SYMBOL(omap_readb);
-
-u16 omap_readw(u32 pa)
-{
-	return __raw_readw(OMAP2_L4_IO_ADDRESS(pa));
-}
-EXPORT_SYMBOL(omap_readw);
-
-u32 omap_readl(u32 pa)
-{
-	return __raw_readl(OMAP2_L4_IO_ADDRESS(pa));
-}
-EXPORT_SYMBOL(omap_readl);
-
-void omap_writeb(u8 v, u32 pa)
-{
-	__raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa));
-}
-EXPORT_SYMBOL(omap_writeb);
-
-void omap_writew(u16 v, u32 pa)
-{
-	__raw_writew(v, OMAP2_L4_IO_ADDRESS(pa));
-}
-EXPORT_SYMBOL(omap_writew);
-
-void omap_writel(u32 v, u32 pa)
-{
-	__raw_writel(v, OMAP2_L4_IO_ADDRESS(pa));
-}
-EXPORT_SYMBOL(omap_writel);
diff --git a/arch/arm/plat-omap/include/plat/keypad.h b/arch/arm/plat-omap/include/plat/keypad.h
index 793ce9d..4b35555 100644
--- a/arch/arm/plat-omap/include/plat/keypad.h
+++ b/arch/arm/plat-omap/include/plat/keypad.h
@@ -12,6 +12,8 @@
 
 #ifndef CONFIG_ARCH_OMAP1
 #warning Please update the board to use matrix-keypad driver
+#define omap_readw(reg)		0
+#define omap_writew(val, reg)	do {} while(0)
 #endif
 #include <linux/input/matrix_keypad.h>
 
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
index dc864b5..5f6ced4 100644
--- a/arch/arm/plat-omap/include/plat/usb.h
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -3,6 +3,7 @@
 #ifndef	__ASM_ARCH_OMAP_USB_H
 #define	__ASM_ARCH_OMAP_USB_H
 
+#include <linux/io.h>
 #include <linux/usb/musb.h>
 #include <plat/board.h>
 
@@ -105,6 +106,45 @@ extern int omap4430_phy_set_clk(struct device *dev, int on);
 extern int omap4430_phy_init(struct device *dev);
 extern int omap4430_phy_exit(struct device *dev);
 extern int omap4430_phy_suspend(struct device *dev, int suspend);
+
+/*
+ * NOTE: Please update omap USB drivers to use ioremap + read/write
+ */
+
+#define OMAP2_L4_IO_OFFSET		0xb2000000
+#define OMAP2_L4_IO_ADDRESS(pa)		IOMEM((pa) + OMAP2_L4_IO_OFFSET)
+
+static inline u8 omap_readb(u32 pa)
+{
+	return __raw_readb(OMAP2_L4_IO_ADDRESS(pa));
+}
+
+static inline u16 omap_readw(u32 pa)
+{
+	return __raw_readw(OMAP2_L4_IO_ADDRESS(pa));
+}
+
+static inline u32 omap_readl(u32 pa)
+{
+	return __raw_readl(OMAP2_L4_IO_ADDRESS(pa));
+}
+
+static inline void omap_writeb(u8 v, u32 pa)
+{
+	__raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa));
+}
+
+
+static inline void omap_writew(u16 v, u32 pa)
+{
+	__raw_writew(v, OMAP2_L4_IO_ADDRESS(pa));
+}
+
+static inline void omap_writel(u32 v, u32 pa)
+{
+	__raw_writel(v, OMAP2_L4_IO_ADDRESS(pa));
+}
+
 #endif
 
 extern void am35x_musb_reset(void);

^ permalink raw reply related

* Re: Kernel Display and Video API Consolidation mini-summit at ELC 2012 - Notes
From: Alan Cox @ 2012-02-23  0:15 UTC (permalink / raw)
  To: Clark, Rob
  Cc: Chris Wilson, Tomasz Stanislawski, linux-fbdev, Sakari Ailus,
	Pawel Osciak, Marcus Lorentzon, Magnus Damm, dri-devel,
	Alexander Deucher, linux-media, Marek Szyprowski
In-Reply-To: <CAO8GWqnVLfu5p3yNbE-BNqXfUu=2JX3S82GoJFS1baRwV126pQ@mail.gmail.com>

> and when doing 2d accel on a 3d core..  it basically amounts to
> putting a shader compiler in the kernel.   Wheeee!

What I did for the GMA500 is to use the GTT to do scrolling by rewriting
the framebuffer GTT tables so they work as a circular buffer and doing a
bit of alignment of buffers.

The end result is faster than most accelerated 2D scrolls unsurprisingly.

Even faster would be to map enough of the start of the object on the end
of the range in repeat and just roll the frame buffer base. That would
get it down to a couple of 32bit I/O writes..

Alan

^ permalink raw reply

* Re: Kernel Display and Video API Consolidation mini-summit at ELC 2012 - Notes
From: Michel Dänzer @ 2012-02-23  7:34 UTC (permalink / raw)
  To: Rob Clark
  Cc: Tomasz Stanislawski, linux-fbdev, Sakari Ailus, Pawel Osciak,
	Marcus Lorentzon, Magnus Damm, dri-devel, Alexander Deucher,
	linux-media, Marek Szyprowski
In-Reply-To: <CAF6AEGs5iNbZB5SOcGWkvQu4Yh98KbWWkWkv3mS_noA76utExw@mail.gmail.com>

On Mit, 2012-02-22 at 10:28 -0600, Rob Clark wrote: 
> On Wed, Feb 22, 2012 at 10:24 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Wed, Feb 22, 2012 at 04:03:21PM +0000, James Simmons wrote:
> >>
> >> > > Imo we should ditch this - fb accel doesn't belong into the kernel. Even
> >> > > on hw that still has a blitter for easy 2d accel without a complete 3d
> >> > > state setup necessary, it's not worth it. Chris Wilson from our team once
> >> > > played around with implementing fb accel in the kernel (i915 hw still has
> >> > > a blitter engine in the latest generations). He quickly noticed that to
> >> > > have decent speed, competitive with s/w rendering by the cpu he needs the
> >> > > entire batch and buffer management stuff from userspace. And to really
> >> > > beat the cpu, you need even more magic.
> >> > >
> >> > > If you want fast 2d accel, use something like cairo.
> >> >
> >> > Our conclusion on this is that we should not expose an explicit 2D
> >> > acceleration API at the kernel level. If really needed, hardware 2D
> >> > acceleration could be implemented as a DRM device to handle memory management,
> >> > commands ring setup, synchronization, ... but I'm not even sure if that's
> >> > worth it. I might not have conveyed it well in my notes.
> >>
> >> Fbcon scrolling at be painful at HD or better modes. Fbcon needs 3
> >> possible accels; copyarea, imageblit, and fillrect. The first two could be
> >> hooked from the TTM layer. Its something I plan to experiment to see if
> >> its worth it.
> >
> > Let's bite into this ;-) I know that fbcon scrolling totally sucks on big
> > screens, but I also think it's a total waste of time to fix this. Imo
> > fbcon has 2 use-cases:
> > - display an OOSP.
> > - allow me to run fsck (or any other desaster-recovery stuff).
> >
> > It can do that quite fine already.
> 
> and for just fbcon scrolling, if you really wanted to you could
> implement it by just shuffling pages around in a GART..

Keep in mind there are still discrete GPUs :), where scanning out from
anything but VRAM may not be feasible, and direct CPU access to
(especially reads from) VRAM tends to be very slow.

However, for fbcon that can be addressed in each driver (as is done e.g.
in nouveau), and has nothing to do with any userspace interface.


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

^ permalink raw reply

* [PATCH] udlfb: Fix invalid return codes in edid sysfs entry store function
From: Olivier Sobrie @ 2012-02-23  7:53 UTC (permalink / raw)
  To: linux-fbdev

Return a negative errno instead of zero in the write function of
the sysfs entry in case of error.
Also add a check on the return value of dlfb_setup_modes().

Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
---
 drivers/video/udlfb.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
index a197731..abbc3fe 100644
--- a/drivers/video/udlfb.c
+++ b/drivers/video/udlfb.c
@@ -1427,19 +1427,22 @@ static ssize_t edid_store(
 	struct device *fbdev = container_of(kobj, struct device, kobj);
 	struct fb_info *fb_info = dev_get_drvdata(fbdev);
 	struct dlfb_data *dev = fb_info->par;
+	int ret;
 
 	/* We only support write of entire EDID at once, no offset*/
 	if ((src_size != EDID_LENGTH) || (src_off != 0))
-		return 0;
+		return -EINVAL;
 
-	dlfb_setup_modes(dev, fb_info, src, src_size);
+	ret = dlfb_setup_modes(dev, fb_info, src, src_size);
+	if (ret)
+		return ret;
 
 	if (dev->edid && (memcmp(src, dev->edid, src_size) = 0)) {
 		pr_info("sysfs written EDID is new default\n");
 		dlfb_ops_set_par(fb_info);
 		return src_size;
 	} else
-		return 0;
+		return -EINVAL;
 }
 
 static ssize_t metrics_reset_store(struct device *fbdev,
-- 
1.7.5.4


^ permalink raw reply related

* [GIT PULL] OMAP DSS fixes for 3.3-rc
From: Tomi Valkeinen @ 2012-02-23  9:22 UTC (permalink / raw)
  To: Florian Tobias Schandinat
  Cc: linux-fbdev@vger.kernel.org, linux-omap mailing list
In-Reply-To: <1327579651.1895.34.camel@deskari>

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

Hi Florian,

Two fixes for OMAP DSS for 3.3:

First one gets the HDMI output working again. Managing the clocks for
OMAP4 is not very simple, and this patch circumvents the problems we
have in the clock framework. It's a clean but rather hacky fix, but it
shouldn't cause any side-effects. The issue will hopefully be fixed
properly with DT when we'll get proper parent-child hierarchy for DSS HW
submodules.

The second one is a simple fix for HDMI hotplug detection, which I
missed when I wrote the HDMI PHY fix
(c49d005b6cc8491fad5b24f82805be2d6bcbd3dd).

 Tomi

The following changes since commit d65b4e98d7ea3038b767b70fe8be959b2913f16d:

  Linux 3.3-rc3 (2012-02-08 19:21:53 -0800)

are available in the git repository at:
  git://gitorious.org/linux-omap-dss2/linux.git for-3.3-rc

Archit Taneja (1):
      OMAPDSS: HACK: Ensure DSS clock domain gets out of idle when HDMI is enabled

Rob Clark (1):
      OMAPDSS: HDMI: hot plug detect fix

 drivers/video/omap2/dss/hdmi.c            |   24 +++++++++++++++++++++++-
 drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c |    9 +--------
 2 files changed, 24 insertions(+), 9 deletions(-)


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH 8/8] ARM: OMAP2+: Limit omap_read/write usage to legacy USB drivers
From: Tony Lindgren @ 2012-02-24 18:25 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20120222224411.GO18185@atomide.com>

* Tony Lindgren <tony@atomide.com> [120222 14:13]:
> * Tony Lindgren <tony@atomide.com> [120222 10:27]:
> > * Tomi Valkeinen <tomi.valkeinen@ti.com> [120221 23:42]:
> > > On Tue, 2012-02-21 at 15:40 -0800, Tony Lindgren wrote:
> > > > Drivers should no longer use omap_read/write functions
> > > > but instead use ioremap + read/write functions.
> > > > 
> > > > As some USB legacy code is still shared between omap1 and
> > > > omap2420, let's limit the omap_read/write to plat/usb.h.
> > > > 
> > > > Also, let's make drivers/video/omap/lcdc.c depend on
> > > > ARCH_OMAP1 as it is not needed for omap2+.
> > > 
> > > I'm ok with the lcdc.c change, but I also have a patch series that makes
> > > the same change, plus removes the omap2 code from drivers/video/omap/.
> > 
> > OK, I'll drop the lcdc.c change from my series as that should
> > only affect randconfig builds.
> 
> Here's this one updated. Noticed one more legacy driver
> that needs omap_read/write defined to build on 2420.

This one needed some updates for usb.h after updating patch 7/8
in this series. Updated patch below.

Regards,

Tony


From: Tony Lindgren <tony@atomide.com>
Date: Wed, 22 Feb 2012 14:52:41 -0800
Subject: [PATCH] ARM: OMAP2+: Limit omap_read/write usage to legacy USB drivers

Drivers should no longer use omap_read/write functions
but instead use ioremap + read/write functions.

As some USB legacy code is still shared between omap1 and
omap2420, let's limit the omap_read/write to plat/usb.h.

Note that the long term fix is to update the drivers to
use ioremap and read/write functions. That can now be
done as a separate patch series that is limited to the
USB drivers.

Also make sure the legacy omap1-keypad.c driver builds
if selected for 2420 based systems.

Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 09ca9e9..f78ec4e 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -242,15 +242,5 @@ struct omap_sdrc_params;
 extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
 				      struct omap_sdrc_params *sdrc_cs1);
 
-/*
- * NOTE: Please use ioremap + __raw_read/write where possible instead of these
- */
-extern u8 omap_readb(u32 pa);
-extern u16 omap_readw(u32 pa);
-extern u32 omap_readl(u32 pa);
-extern void omap_writeb(u8 v, u32 pa);
-extern void omap_writew(u16 v, u32 pa);
-extern void omap_writel(u32 v, u32 pa);
-
 #endif /* __ASSEMBLER__ */
 #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 0119807..3203128 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -487,43 +487,3 @@ void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
 		_omap2_init_reprogram_sdrc();
 	}
 }
-
-/*
- * NOTE: Please use ioremap + __raw_read/write where possible instead of these
- */
-
-u8 omap_readb(u32 pa)
-{
-	return __raw_readb(OMAP2_L4_IO_ADDRESS(pa));
-}
-EXPORT_SYMBOL(omap_readb);
-
-u16 omap_readw(u32 pa)
-{
-	return __raw_readw(OMAP2_L4_IO_ADDRESS(pa));
-}
-EXPORT_SYMBOL(omap_readw);
-
-u32 omap_readl(u32 pa)
-{
-	return __raw_readl(OMAP2_L4_IO_ADDRESS(pa));
-}
-EXPORT_SYMBOL(omap_readl);
-
-void omap_writeb(u8 v, u32 pa)
-{
-	__raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa));
-}
-EXPORT_SYMBOL(omap_writeb);
-
-void omap_writew(u16 v, u32 pa)
-{
-	__raw_writew(v, OMAP2_L4_IO_ADDRESS(pa));
-}
-EXPORT_SYMBOL(omap_writew);
-
-void omap_writel(u32 v, u32 pa)
-{
-	__raw_writel(v, OMAP2_L4_IO_ADDRESS(pa));
-}
-EXPORT_SYMBOL(omap_writel);
diff --git a/arch/arm/plat-omap/include/plat/keypad.h b/arch/arm/plat-omap/include/plat/keypad.h
index 793ce9d..a6b21ed 100644
--- a/arch/arm/plat-omap/include/plat/keypad.h
+++ b/arch/arm/plat-omap/include/plat/keypad.h
@@ -12,6 +12,8 @@
 
 #ifndef CONFIG_ARCH_OMAP1
 #warning Please update the board to use matrix-keypad driver
+#define omap_readw(reg)		0
+#define omap_writew(val, reg)	do {} while (0)
 #endif
 #include <linux/input/matrix_keypad.h>
 
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
index dc864b5..d0fc9f4 100644
--- a/arch/arm/plat-omap/include/plat/usb.h
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -3,6 +3,7 @@
 #ifndef	__ASM_ARCH_OMAP_USB_H
 #define	__ASM_ARCH_OMAP_USB_H
 
+#include <linux/io.h>
 #include <linux/usb/musb.h>
 #include <plat/board.h>
 
@@ -105,6 +106,46 @@ extern int omap4430_phy_set_clk(struct device *dev, int on);
 extern int omap4430_phy_init(struct device *dev);
 extern int omap4430_phy_exit(struct device *dev);
 extern int omap4430_phy_suspend(struct device *dev, int suspend);
+
+/*
+ * NOTE: Please update omap USB drivers to use ioremap + read/write
+ */
+
+#define OMAP2_L4_IO_OFFSET	0xb2000000
+#define IOMEM(x)		((void __force __iomem *)(x))
+#define OMAP2_L4_IO_ADDRESS(pa)	IOMEM((pa) + OMAP2_L4_IO_OFFSET)
+
+static inline u8 omap_readb(u32 pa)
+{
+	return __raw_readb(OMAP2_L4_IO_ADDRESS(pa));
+}
+
+static inline u16 omap_readw(u32 pa)
+{
+	return __raw_readw(OMAP2_L4_IO_ADDRESS(pa));
+}
+
+static inline u32 omap_readl(u32 pa)
+{
+	return __raw_readl(OMAP2_L4_IO_ADDRESS(pa));
+}
+
+static inline void omap_writeb(u8 v, u32 pa)
+{
+	__raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa));
+}
+
+
+static inline void omap_writew(u16 v, u32 pa)
+{
+	__raw_writew(v, OMAP2_L4_IO_ADDRESS(pa));
+}
+
+static inline void omap_writel(u32 v, u32 pa)
+{
+	__raw_writel(v, OMAP2_L4_IO_ADDRESS(pa));
+}
+
 #endif
 
 extern void am35x_musb_reset(void);

^ permalink raw reply related

* [PATCH] pxafb: do console locking before calling fb_blank()
From: Vasily Khoruzhick @ 2012-02-26 13:52 UTC (permalink / raw)
  To: linux-arm-kernel

Otherwise we hit WARN_CONSOLE_UNLOCKED in do_unblank_screen

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 drivers/video/pxafb.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index 1d1e4f1..c176561 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -54,6 +54,7 @@
 #include <linux/mutex.h>
 #include <linux/kthread.h>
 #include <linux/freezer.h>
+#include <linux/console.h>
 
 #include <mach/hardware.h>
 #include <asm/io.h>
@@ -730,9 +731,12 @@ static int overlayfb_open(struct fb_info *info, int user)
 	if (user = 0)
 		return -ENODEV;
 
-	if (ofb->usage++ = 0)
+	if (ofb->usage++ = 0) {
 		/* unblank the base framebuffer */
+		console_lock();
 		fb_blank(&ofb->fbi->fb, FB_BLANK_UNBLANK);
+		console_unlock();
+	}
 
 	return 0;
 }
-- 
1.7.9.2


^ permalink raw reply related

* [PATCH] [trivial] radeon: Fix typo in radeon_gem.c
From: Masanari Iida @ 2012-02-27 14:28 UTC (permalink / raw)
  To: benh, linux-fbdev; +Cc: trivial, linux-kernel, Masanari Iida

Correct spelling "withou" to "without" in
drivers/gpu/drm/radeon/radeon_gem.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
---
 drivers/gpu/drm/radeon/radeon_gem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
index 7337850..ff4ff23 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -117,7 +117,7 @@ int radeon_gem_set_domain(struct drm_gem_object *gobj,
 	}
 	if (!domain) {
 		/* Do nothings */
-		printk(KERN_WARNING "Set domain withou domain !\n");
+		printk(KERN_WARNING "Set domain without domain !\n");
 		return 0;
 	}
 	if (domain = RADEON_GEM_DOMAIN_CPU) {
-- 
1.7.9.2.262.gba998


^ permalink raw reply related

* [PATCH] video: s3c-fb: Add support EXYNOS5 FIMD
From: Jingoo Han @ 2012-02-28  7:55 UTC (permalink / raw)
  To: linux-fbdev

This patch adds s3c_fb_driverdata s3c_fb_data_exynos5 for EXYNOS5
and adds extended timing control setting.

EXYNOS5 FIMD needs extended setting for video timing control.
Additional bits are added to VIDTCON2, VIDWxxADD2, VIDOSDxA and
VIDOSDxB registers in order to set timing value for lager resolution.

Also, address offset of VIDCONx registers is changed from 0x0
to 0x20000, thus variable type should be changed to int type
to handle the address offset of VIDCONx registers for EXYNOS5 FIMD.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 arch/arm/plat-samsung/include/plat/regs-fb.h |   24 ++++++++----
 drivers/video/s3c-fb.c                       |   52 +++++++++++++++++++++++--
 2 files changed, 63 insertions(+), 13 deletions(-)

diff --git a/arch/arm/plat-samsung/include/plat/regs-fb.h b/arch/arm/plat-samsung/include/plat/regs-fb.h
index bbb16e0..9a78012 100644
--- a/arch/arm/plat-samsung/include/plat/regs-fb.h
+++ b/arch/arm/plat-samsung/include/plat/regs-fb.h
@@ -167,15 +167,17 @@
 #define VIDTCON1_HSPW(_x)			((_x) << 0)
 
 #define VIDTCON2				(0x18)
+#define VIDTCON2_LINEVAL_E(_x)			((((_x) & 0x800) >> 11) << 23)
 #define VIDTCON2_LINEVAL_MASK			(0x7ff << 11)
 #define VIDTCON2_LINEVAL_SHIFT			(11)
 #define VIDTCON2_LINEVAL_LIMIT			(0x7ff)
-#define VIDTCON2_LINEVAL(_x)			((_x) << 11)
+#define VIDTCON2_LINEVAL(_x)			(((_x) & 0x7ff) << 11)
 
+#define VIDTCON2_HOZVAL_E(_x)			((((_x) & 0x800) >> 11) << 22)
 #define VIDTCON2_HOZVAL_MASK			(0x7ff << 0)
 #define VIDTCON2_HOZVAL_SHIFT			(0)
 #define VIDTCON2_HOZVAL_LIMIT			(0x7ff)
-#define VIDTCON2_HOZVAL(_x)			((_x) << 0)
+#define VIDTCON2_HOZVAL(_x)			(((_x) & 0x7ff) << 0)
 
 /* WINCONx */
 
@@ -231,25 +233,29 @@
 /* Local input channels (windows 0-2) */
 #define SHADOWCON_CHx_LOCAL_ENABLE(_win)	(1 << (5 + (_win)))
 
+#define VIDOSDxA_TOPLEFT_X_E(_x)		((((_x) & 0x800) >> 11) << 23)
 #define VIDOSDxA_TOPLEFT_X_MASK			(0x7ff << 11)
 #define VIDOSDxA_TOPLEFT_X_SHIFT		(11)
 #define VIDOSDxA_TOPLEFT_X_LIMIT		(0x7ff)
-#define VIDOSDxA_TOPLEFT_X(_x)			((_x) << 11)
+#define VIDOSDxA_TOPLEFT_X(_x)			(((_x) & 0x7ff) << 11)
 
+#define VIDOSDxA_TOPLEFT_Y_E(_x)		((((_x) & 0x800) >> 11) << 22)
 #define VIDOSDxA_TOPLEFT_Y_MASK			(0x7ff << 0)
 #define VIDOSDxA_TOPLEFT_Y_SHIFT		(0)
 #define VIDOSDxA_TOPLEFT_Y_LIMIT		(0x7ff)
-#define VIDOSDxA_TOPLEFT_Y(_x)			((_x) << 0)
+#define VIDOSDxA_TOPLEFT_Y(_x)			(((_x) & 0x7ff) << 0)
 
+#define VIDOSDxB_BOTRIGHT_X_E(_x)		((((_x) & 0x800) >> 11) << 23)
 #define VIDOSDxB_BOTRIGHT_X_MASK		(0x7ff << 11)
 #define VIDOSDxB_BOTRIGHT_X_SHIFT		(11)
 #define VIDOSDxB_BOTRIGHT_X_LIMIT		(0x7ff)
-#define VIDOSDxB_BOTRIGHT_X(_x)			((_x) << 11)
+#define VIDOSDxB_BOTRIGHT_X(_x)			(((_x) & 0x7ff) << 11)
 
+#define VIDOSDxB_BOTRIGHT_Y_E(_x)		((((_x) & 0x800) >> 11) << 22)
 #define VIDOSDxB_BOTRIGHT_Y_MASK		(0x7ff << 0)
 #define VIDOSDxB_BOTRIGHT_Y_SHIFT		(0)
 #define VIDOSDxB_BOTRIGHT_Y_LIMIT		(0x7ff)
-#define VIDOSDxB_BOTRIGHT_Y(_x)			((_x) << 0)
+#define VIDOSDxB_BOTRIGHT_Y(_x)			(((_x) & 0x7ff) << 0)
 
 /* For VIDOSD[1..4]C */
 #define VIDISD14C_ALPHA0_R(_x)			((_x) << 20)
@@ -281,15 +287,17 @@
 #define VIDW_BUF_END1(_buff)			(0xD4 + ((_buff) * 8))
 #define VIDW_BUF_SIZE(_buff)			(0x100 + ((_buff) * 4))
 
+#define VIDW_BUF_SIZE_OFFSET_E(_x)		((((_x) & 0x2000) >> 13) << 27)
 #define VIDW_BUF_SIZE_OFFSET_MASK		(0x1fff << 13)
 #define VIDW_BUF_SIZE_OFFSET_SHIFT		(13)
 #define VIDW_BUF_SIZE_OFFSET_LIMIT		(0x1fff)
-#define VIDW_BUF_SIZE_OFFSET(_x)		((_x) << 13)
+#define VIDW_BUF_SIZE_OFFSET(_x)		(((_x) & 0x1fff) << 13)
 
+#define VIDW_BUF_SIZE_PAGEWIDTH_E(_x)		((((_x) & 0x2000) >> 13) << 26)
 #define VIDW_BUF_SIZE_PAGEWIDTH_MASK		(0x1fff << 0)
 #define VIDW_BUF_SIZE_PAGEWIDTH_SHIFT		(0)
 #define VIDW_BUF_SIZE_PAGEWIDTH_LIMIT		(0x1fff)
-#define VIDW_BUF_SIZE_PAGEWIDTH(_x)		((_x) << 0)
+#define VIDW_BUF_SIZE_PAGEWIDTH(_x)		(((_x) & 0x1fff) << 0)
 
 /* Interrupt controls and status */
 
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 1fb7ddf..f310516 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -89,7 +89,7 @@ struct s3c_fb;
 struct s3c_fb_variant {
 	unsigned int	is_2443:1;
 	unsigned short	nr_windows;
-	unsigned short	vidtcon;
+	unsigned int	vidtcon;
 	unsigned short	wincon;
 	unsigned short	winmap;
 	unsigned short	keycon;
@@ -568,7 +568,9 @@ static int s3c_fb_set_par(struct fb_info *info)
 		writel(data, regs + sfb->variant.vidtcon + 4);
 
 		data = VIDTCON2_LINEVAL(var->yres - 1) |
-		       VIDTCON2_HOZVAL(var->xres - 1);
+		       VIDTCON2_HOZVAL(var->xres - 1) |
+		       VIDTCON2_LINEVAL_E(var->yres - 1) |
+		       VIDTCON2_HOZVAL_E(var->xres - 1);
 		writel(data, regs + sfb->variant.vidtcon + 8);
 	}
 
@@ -584,17 +586,23 @@ static int s3c_fb_set_par(struct fb_info *info)
 
 	pagewidth = (var->xres * var->bits_per_pixel) >> 3;
 	data = VIDW_BUF_SIZE_OFFSET(info->fix.line_length - pagewidth) |
-	       VIDW_BUF_SIZE_PAGEWIDTH(pagewidth);
+	       VIDW_BUF_SIZE_PAGEWIDTH(pagewidth) |
+	       VIDW_BUF_SIZE_OFFSET_E(info->fix.line_length - pagewidth) |
+	       VIDW_BUF_SIZE_PAGEWIDTH_E(pagewidth);
 	writel(data, regs + sfb->variant.buf_size + (win_no * 4));
 
 	/* write 'OSD' registers to control position of framebuffer */
 
-	data = VIDOSDxA_TOPLEFT_X(0) | VIDOSDxA_TOPLEFT_Y(0);
+	data = VIDOSDxA_TOPLEFT_X(0) | VIDOSDxA_TOPLEFT_Y(0) |
+	       VIDOSDxA_TOPLEFT_X_E(0) | VIDOSDxA_TOPLEFT_Y_E(0);
 	writel(data, regs + VIDOSD_A(win_no, sfb->variant));
 
 	data = VIDOSDxB_BOTRIGHT_X(s3c_fb_align_word(var->bits_per_pixel,
 						     var->xres - 1)) |
-	       VIDOSDxB_BOTRIGHT_Y(var->yres - 1);
+	       VIDOSDxB_BOTRIGHT_Y(var->yres - 1) |
+	       VIDOSDxB_BOTRIGHT_X_E(s3c_fb_align_word(var->bits_per_pixel,
+						     var->xres - 1)) |
+	       VIDOSDxB_BOTRIGHT_Y_E(var->yres - 1);
 
 	writel(data, regs + VIDOSD_B(win_no, sfb->variant));
 
@@ -1903,6 +1911,37 @@ static struct s3c_fb_driverdata s3c_fb_data_exynos4 = {
 	.win[4]	= &s3c_fb_data_s5p_wins[4],
 };
 
+static struct s3c_fb_driverdata s3c_fb_data_exynos5 = {
+	.variant = {
+		.nr_windows	= 5,
+		.vidtcon	= VIDTCON0,
+		.wincon		= WINCON(0),
+		.winmap		= WINxMAP(0),
+		.keycon		= WKEYCON,
+		.osd		= VIDOSD_BASE,
+		.osd_stride	= 16,
+		.buf_start	= VIDW_BUF_START(0),
+		.buf_size	= VIDW_BUF_SIZE(0),
+		.buf_end	= VIDW_BUF_END(0),
+
+		.palette = {
+			[0] = 0x2400,
+			[1] = 0x2800,
+			[2] = 0x2c00,
+			[3] = 0x3000,
+			[4] = 0x3400,
+		},
+		.has_shadowcon	= 1,
+		.has_blendcon	= 1,
+		.has_fixvclk	= 1,
+	},
+	.win[0]	= &s3c_fb_data_s5p_wins[0],
+	.win[1]	= &s3c_fb_data_s5p_wins[1],
+	.win[2]	= &s3c_fb_data_s5p_wins[2],
+	.win[3]	= &s3c_fb_data_s5p_wins[3],
+	.win[4]	= &s3c_fb_data_s5p_wins[4],
+};
+
 /* S3C2443/S3C2416 style hardware */
 static struct s3c_fb_driverdata s3c_fb_data_s3c2443 = {
 	.variant = {
@@ -1981,6 +2020,9 @@ static struct platform_device_id s3c_fb_driver_ids[] = {
 		.name		= "exynos4-fb",
 		.driver_data	= (unsigned long)&s3c_fb_data_exynos4,
 	}, {
+		.name		= "exynos5-fb",
+		.driver_data	= (unsigned long)&s3c_fb_data_exynos5,
+	}, {
 		.name		= "s3c2443-fb",
 		.driver_data	= (unsigned long)&s3c_fb_data_s3c2443,
 	}, {
-- 
1.7.1



^ permalink raw reply related

* PATCH V2] video: s3c-fb: Add support EXYNOS5 FIMD
From: Jingoo Han @ 2012-02-28 11:41 UTC (permalink / raw)
  To: linux-fbdev

This patch adds s3c_fb_driverdata s3c_fb_data_exynos5 for EXYNOS5
and adds extended timing control setting.

EXYNOS5 FIMD needs extended setting for video timing control.
Additional bits are added to VIDTCON2, VIDWxxADD2, VIDOSDxA and
VIDOSDxB registers in order to set timing value for lager resolution.

Also, address offset of VIDTCONx registers is changed from 0x0
to 0x20000, thus variable type should be changed to int type
to handle the address offset of VIDTCONx registers for EXYNOS5 FIMD.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
v2: fix commit message from VIDCONx to VIDTCONx.

 arch/arm/plat-samsung/include/plat/regs-fb.h |   24 ++++++++----
 drivers/video/s3c-fb.c                       |   52 +++++++++++++++++++++++--
 2 files changed, 63 insertions(+), 13 deletions(-)

diff --git a/arch/arm/plat-samsung/include/plat/regs-fb.h b/arch/arm/plat-samsung/include/plat/regs-fb.h
index bbb16e0..9a78012 100644
--- a/arch/arm/plat-samsung/include/plat/regs-fb.h
+++ b/arch/arm/plat-samsung/include/plat/regs-fb.h
@@ -167,15 +167,17 @@
 #define VIDTCON1_HSPW(_x)			((_x) << 0)
 
 #define VIDTCON2				(0x18)
+#define VIDTCON2_LINEVAL_E(_x)			((((_x) & 0x800) >> 11) << 23)
 #define VIDTCON2_LINEVAL_MASK			(0x7ff << 11)
 #define VIDTCON2_LINEVAL_SHIFT			(11)
 #define VIDTCON2_LINEVAL_LIMIT			(0x7ff)
-#define VIDTCON2_LINEVAL(_x)			((_x) << 11)
+#define VIDTCON2_LINEVAL(_x)			(((_x) & 0x7ff) << 11)
 
+#define VIDTCON2_HOZVAL_E(_x)			((((_x) & 0x800) >> 11) << 22)
 #define VIDTCON2_HOZVAL_MASK			(0x7ff << 0)
 #define VIDTCON2_HOZVAL_SHIFT			(0)
 #define VIDTCON2_HOZVAL_LIMIT			(0x7ff)
-#define VIDTCON2_HOZVAL(_x)			((_x) << 0)
+#define VIDTCON2_HOZVAL(_x)			(((_x) & 0x7ff) << 0)
 
 /* WINCONx */
 
@@ -231,25 +233,29 @@
 /* Local input channels (windows 0-2) */
 #define SHADOWCON_CHx_LOCAL_ENABLE(_win)	(1 << (5 + (_win)))
 
+#define VIDOSDxA_TOPLEFT_X_E(_x)		((((_x) & 0x800) >> 11) << 23)
 #define VIDOSDxA_TOPLEFT_X_MASK			(0x7ff << 11)
 #define VIDOSDxA_TOPLEFT_X_SHIFT		(11)
 #define VIDOSDxA_TOPLEFT_X_LIMIT		(0x7ff)
-#define VIDOSDxA_TOPLEFT_X(_x)			((_x) << 11)
+#define VIDOSDxA_TOPLEFT_X(_x)			(((_x) & 0x7ff) << 11)
 
+#define VIDOSDxA_TOPLEFT_Y_E(_x)		((((_x) & 0x800) >> 11) << 22)
 #define VIDOSDxA_TOPLEFT_Y_MASK			(0x7ff << 0)
 #define VIDOSDxA_TOPLEFT_Y_SHIFT		(0)
 #define VIDOSDxA_TOPLEFT_Y_LIMIT		(0x7ff)
-#define VIDOSDxA_TOPLEFT_Y(_x)			((_x) << 0)
+#define VIDOSDxA_TOPLEFT_Y(_x)			(((_x) & 0x7ff) << 0)
 
+#define VIDOSDxB_BOTRIGHT_X_E(_x)		((((_x) & 0x800) >> 11) << 23)
 #define VIDOSDxB_BOTRIGHT_X_MASK		(0x7ff << 11)
 #define VIDOSDxB_BOTRIGHT_X_SHIFT		(11)
 #define VIDOSDxB_BOTRIGHT_X_LIMIT		(0x7ff)
-#define VIDOSDxB_BOTRIGHT_X(_x)			((_x) << 11)
+#define VIDOSDxB_BOTRIGHT_X(_x)			(((_x) & 0x7ff) << 11)
 
+#define VIDOSDxB_BOTRIGHT_Y_E(_x)		((((_x) & 0x800) >> 11) << 22)
 #define VIDOSDxB_BOTRIGHT_Y_MASK		(0x7ff << 0)
 #define VIDOSDxB_BOTRIGHT_Y_SHIFT		(0)
 #define VIDOSDxB_BOTRIGHT_Y_LIMIT		(0x7ff)
-#define VIDOSDxB_BOTRIGHT_Y(_x)			((_x) << 0)
+#define VIDOSDxB_BOTRIGHT_Y(_x)			(((_x) & 0x7ff) << 0)
 
 /* For VIDOSD[1..4]C */
 #define VIDISD14C_ALPHA0_R(_x)			((_x) << 20)
@@ -281,15 +287,17 @@
 #define VIDW_BUF_END1(_buff)			(0xD4 + ((_buff) * 8))
 #define VIDW_BUF_SIZE(_buff)			(0x100 + ((_buff) * 4))
 
+#define VIDW_BUF_SIZE_OFFSET_E(_x)		((((_x) & 0x2000) >> 13) << 27)
 #define VIDW_BUF_SIZE_OFFSET_MASK		(0x1fff << 13)
 #define VIDW_BUF_SIZE_OFFSET_SHIFT		(13)
 #define VIDW_BUF_SIZE_OFFSET_LIMIT		(0x1fff)
-#define VIDW_BUF_SIZE_OFFSET(_x)		((_x) << 13)
+#define VIDW_BUF_SIZE_OFFSET(_x)		(((_x) & 0x1fff) << 13)
 
+#define VIDW_BUF_SIZE_PAGEWIDTH_E(_x)		((((_x) & 0x2000) >> 13) << 26)
 #define VIDW_BUF_SIZE_PAGEWIDTH_MASK		(0x1fff << 0)
 #define VIDW_BUF_SIZE_PAGEWIDTH_SHIFT		(0)
 #define VIDW_BUF_SIZE_PAGEWIDTH_LIMIT		(0x1fff)
-#define VIDW_BUF_SIZE_PAGEWIDTH(_x)		((_x) << 0)
+#define VIDW_BUF_SIZE_PAGEWIDTH(_x)		(((_x) & 0x1fff) << 0)
 
 /* Interrupt controls and status */
 
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 1fb7ddf..f310516 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -89,7 +89,7 @@ struct s3c_fb;
 struct s3c_fb_variant {
 	unsigned int	is_2443:1;
 	unsigned short	nr_windows;
-	unsigned short	vidtcon;
+	unsigned int	vidtcon;
 	unsigned short	wincon;
 	unsigned short	winmap;
 	unsigned short	keycon;
@@ -568,7 +568,9 @@ static int s3c_fb_set_par(struct fb_info *info)
 		writel(data, regs + sfb->variant.vidtcon + 4);
 
 		data = VIDTCON2_LINEVAL(var->yres - 1) |
-		       VIDTCON2_HOZVAL(var->xres - 1);
+		       VIDTCON2_HOZVAL(var->xres - 1) |
+		       VIDTCON2_LINEVAL_E(var->yres - 1) |
+		       VIDTCON2_HOZVAL_E(var->xres - 1);
 		writel(data, regs + sfb->variant.vidtcon + 8);
 	}
 
@@ -584,17 +586,23 @@ static int s3c_fb_set_par(struct fb_info *info)
 
 	pagewidth = (var->xres * var->bits_per_pixel) >> 3;
 	data = VIDW_BUF_SIZE_OFFSET(info->fix.line_length - pagewidth) |
-	       VIDW_BUF_SIZE_PAGEWIDTH(pagewidth);
+	       VIDW_BUF_SIZE_PAGEWIDTH(pagewidth) |
+	       VIDW_BUF_SIZE_OFFSET_E(info->fix.line_length - pagewidth) |
+	       VIDW_BUF_SIZE_PAGEWIDTH_E(pagewidth);
 	writel(data, regs + sfb->variant.buf_size + (win_no * 4));
 
 	/* write 'OSD' registers to control position of framebuffer */
 
-	data = VIDOSDxA_TOPLEFT_X(0) | VIDOSDxA_TOPLEFT_Y(0);
+	data = VIDOSDxA_TOPLEFT_X(0) | VIDOSDxA_TOPLEFT_Y(0) |
+	       VIDOSDxA_TOPLEFT_X_E(0) | VIDOSDxA_TOPLEFT_Y_E(0);
 	writel(data, regs + VIDOSD_A(win_no, sfb->variant));
 
 	data = VIDOSDxB_BOTRIGHT_X(s3c_fb_align_word(var->bits_per_pixel,
 						     var->xres - 1)) |
-	       VIDOSDxB_BOTRIGHT_Y(var->yres - 1);
+	       VIDOSDxB_BOTRIGHT_Y(var->yres - 1) |
+	       VIDOSDxB_BOTRIGHT_X_E(s3c_fb_align_word(var->bits_per_pixel,
+						     var->xres - 1)) |
+	       VIDOSDxB_BOTRIGHT_Y_E(var->yres - 1);
 
 	writel(data, regs + VIDOSD_B(win_no, sfb->variant));
 
@@ -1903,6 +1911,37 @@ static struct s3c_fb_driverdata s3c_fb_data_exynos4 = {
 	.win[4]	= &s3c_fb_data_s5p_wins[4],
 };
 
+static struct s3c_fb_driverdata s3c_fb_data_exynos5 = {
+	.variant = {
+		.nr_windows	= 5,
+		.vidtcon	= VIDTCON0,
+		.wincon		= WINCON(0),
+		.winmap		= WINxMAP(0),
+		.keycon		= WKEYCON,
+		.osd		= VIDOSD_BASE,
+		.osd_stride	= 16,
+		.buf_start	= VIDW_BUF_START(0),
+		.buf_size	= VIDW_BUF_SIZE(0),
+		.buf_end	= VIDW_BUF_END(0),
+
+		.palette = {
+			[0] = 0x2400,
+			[1] = 0x2800,
+			[2] = 0x2c00,
+			[3] = 0x3000,
+			[4] = 0x3400,
+		},
+		.has_shadowcon	= 1,
+		.has_blendcon	= 1,
+		.has_fixvclk	= 1,
+	},
+	.win[0]	= &s3c_fb_data_s5p_wins[0],
+	.win[1]	= &s3c_fb_data_s5p_wins[1],
+	.win[2]	= &s3c_fb_data_s5p_wins[2],
+	.win[3]	= &s3c_fb_data_s5p_wins[3],
+	.win[4]	= &s3c_fb_data_s5p_wins[4],
+};
+
 /* S3C2443/S3C2416 style hardware */
 static struct s3c_fb_driverdata s3c_fb_data_s3c2443 = {
 	.variant = {
@@ -1981,6 +2020,9 @@ static struct platform_device_id s3c_fb_driver_ids[] = {
 		.name		= "exynos4-fb",
 		.driver_data	= (unsigned long)&s3c_fb_data_exynos4,
 	}, {
+		.name		= "exynos5-fb",
+		.driver_data	= (unsigned long)&s3c_fb_data_exynos5,
+	}, {
 		.name		= "s3c2443-fb",
 		.driver_data	= (unsigned long)&s3c_fb_data_s3c2443,
 	}, {
-- 
1.7.1



^ permalink raw reply related

* Re: [PATCH] drivers/video/pxa168fb.c: use devm_ functions
From: Florian Tobias Schandinat @ 2012-02-28 15:54 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, linux-fbdev, linux-kernel
In-Reply-To: <1329589169-18235-1-git-send-email-Julia.Lawall@lip6.fr>

On 02/18/2012 06:19 PM, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> The various devm_ functions allocate memory that is released when a driver
> detaches.  This patch uses these functions for data that is allocated in
> the probe function of a platform device and is only freed in the remove
> function.
> 
> By using devm_ioremap, it also removes a potential memory leak, because
> there was no call to iounmap in the probe function.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied.


Thanks,

Florian Tobias Schandinat

> 
> ---
>  drivers/video/pxa168fb.c |   15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c
> index 8384b94..f146089 100644
> --- a/drivers/video/pxa168fb.c
> +++ b/drivers/video/pxa168fb.c
> @@ -21,6 +21,7 @@
>  #include <linux/fb.h>
>  #include <linux/delay.h>
>  #include <linux/init.h>
> +#include <linux/io.h>
>  #include <linux/ioport.h>
>  #include <linux/platform_device.h>
>  #include <linux/dma-mapping.h>
> @@ -670,7 +671,8 @@ static int __devinit pxa168fb_probe(struct platform_device *pdev)
>  	/*
>  	 * Map LCD controller registers.
>  	 */
> -	fbi->reg_base = ioremap_nocache(res->start, resource_size(res));
> +	fbi->reg_base = devm_ioremap_nocache(&pdev->dev, res->start,
> +					     resource_size(res));
>  	if (fbi->reg_base = NULL) {
>  		ret = -ENOMEM;
>  		goto failed_free_info;
> @@ -739,8 +741,8 @@ static int __devinit pxa168fb_probe(struct platform_device *pdev)
>  	/*
>  	 * Register irq handler.
>  	 */
> -	ret = request_irq(irq, pxa168fb_handle_irq, IRQF_SHARED,
> -					info->fix.id, fbi);
> +	ret = devm_request_irq(&pdev->dev, irq, pxa168fb_handle_irq,
> +			       IRQF_SHARED, info->fix.id, fbi);
>  	if (ret < 0) {
>  		dev_err(&pdev->dev, "unable to request IRQ\n");
>  		ret = -ENXIO;
> @@ -759,14 +761,12 @@ static int __devinit pxa168fb_probe(struct platform_device *pdev)
>  	if (ret < 0) {
>  		dev_err(&pdev->dev, "Failed to register pxa168-fb: %d\n", ret);
>  		ret = -ENXIO;
> -		goto failed_free_irq;
> +		goto failed_free_cmap;
>  	}
>  
>  	platform_set_drvdata(pdev, fbi);
>  	return 0;
>  
> -failed_free_irq:
> -	free_irq(irq, fbi);
>  failed_free_cmap:
>  	fb_dealloc_cmap(&info->cmap);
>  failed_free_clk:
> @@ -808,13 +808,10 @@ static int __devexit pxa168fb_remove(struct platform_device *pdev)
>  		fb_dealloc_cmap(&info->cmap);
>  
>  	irq = platform_get_irq(pdev, 0);
> -	free_irq(irq, fbi);
>  
>  	dma_free_writecombine(fbi->dev, PAGE_ALIGN(info->fix.smem_len),
>  				info->screen_base, info->fix.smem_start);
>  
> -	iounmap(fbi->reg_base);
> -
>  	clk_disable(fbi->clk);
>  	clk_put(fbi->clk);
>  
> 
> 


^ permalink raw reply

* Re: [PATCH] video: s3c-fb: use devm_request_irq()
From: Florian Tobias Schandinat @ 2012-02-28 15:55 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <017101ccefbc$0ab90710$202b1530$%han@samsung.com>

On 02/20/2012 10:40 AM, Jingoo Han wrote:
> The devm_ functions allocate memory that is released when a driver
> detaches. This patch uses devm_request_irq of these functions.
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>

Applied.


Thanks,

Florian Tobias Schandinat

> ---
>  drivers/video/s3c-fb.c |    5 +----
>  1 files changed, 1 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
> index e22bf9d..1fb7ddf 100644
> --- a/drivers/video/s3c-fb.c
> +++ b/drivers/video/s3c-fb.c
> @@ -1433,7 +1433,7 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev)
>  		goto err_lcd_clk;
>  	}
>  	sfb->irq_no = res->start;
> -	ret = request_irq(sfb->irq_no, s3c_fb_irq,
> +	ret = devm_request_irq(dev, sfb->irq_no, s3c_fb_irq,
>  			  0, "s3c_fb", sfb);
>  	if (ret) {
>  		dev_err(dev, "irq request failed\n");
> @@ -1499,7 +1499,6 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev)
>  
>  err_pm_runtime:
>  	pm_runtime_put_sync(sfb->dev);
> -	free_irq(sfb->irq_no, sfb);
>  
>  err_lcd_clk:
>  	pm_runtime_disable(sfb->dev);
> @@ -1535,8 +1534,6 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev)
>  		if (sfb->windows[win])
>  			s3c_fb_release_win(sfb, sfb->windows[win]);
>  
> -	free_irq(sfb->irq_no, sfb);
> -
>  	if (!sfb->variant.has_clksel) {
>  		clk_disable(sfb->lcd_clk);
>  		clk_put(sfb->lcd_clk);


^ permalink raw reply

* Re: [GIT PULL] OMAP DSS fixes for 3.3-rc
From: Florian Tobias Schandinat @ 2012-02-28 16:03 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-fbdev@vger.kernel.org, linux-omap mailing list
In-Reply-To: <1329988974.1820.62.camel@deskari>

On 02/23/2012 09:22 AM, Tomi Valkeinen wrote:
> Hi Florian,
> 
> Two fixes for OMAP DSS for 3.3:
> 
> First one gets the HDMI output working again. Managing the clocks for
> OMAP4 is not very simple, and this patch circumvents the problems we
> have in the clock framework. It's a clean but rather hacky fix, but it
> shouldn't cause any side-effects. The issue will hopefully be fixed
> properly with DT when we'll get proper parent-child hierarchy for DSS HW
> submodules.
> 
> The second one is a simple fix for HDMI hotplug detection, which I
> missed when I wrote the HDMI PHY fix
> (c49d005b6cc8491fad5b24f82805be2d6bcbd3dd).

Merged. You would add
Cc: stable@vger.kernel.org
to patches if appropriate?


Thanks,

Florian Tobias Schandinat

> 
>  Tomi
> 
> The following changes since commit d65b4e98d7ea3038b767b70fe8be959b2913f16d:
> 
>   Linux 3.3-rc3 (2012-02-08 19:21:53 -0800)
> 
> are available in the git repository at:
>   git://gitorious.org/linux-omap-dss2/linux.git for-3.3-rc
> 
> Archit Taneja (1):
>       OMAPDSS: HACK: Ensure DSS clock domain gets out of idle when HDMI is enabled
> 
> Rob Clark (1):
>       OMAPDSS: HDMI: hot plug detect fix
> 
>  drivers/video/omap2/dss/hdmi.c            |   24 +++++++++++++++++++++++-
>  drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c |    9 +--------
>  2 files changed, 24 insertions(+), 9 deletions(-)
> 


^ permalink raw reply

* Re: [GIT PULL] OMAP DSS fixes for 3.3-rc
From: Tomi Valkeinen @ 2012-02-28 16:08 UTC (permalink / raw)
  To: Florian Tobias Schandinat
  Cc: linux-fbdev@vger.kernel.org, linux-omap mailing list
In-Reply-To: <4F4CFAD1.1000301@gmx.de>

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

On Tue, 2012-02-28 at 16:03 +0000, Florian Tobias Schandinat wrote:
> On 02/23/2012 09:22 AM, Tomi Valkeinen wrote:
> > Hi Florian,
> > 
> > Two fixes for OMAP DSS for 3.3:
> > 
> > First one gets the HDMI output working again. Managing the clocks for
> > OMAP4 is not very simple, and this patch circumvents the problems we
> > have in the clock framework. It's a clean but rather hacky fix, but it
> > shouldn't cause any side-effects. The issue will hopefully be fixed
> > properly with DT when we'll get proper parent-child hierarchy for DSS HW
> > submodules.
> > 
> > The second one is a simple fix for HDMI hotplug detection, which I
> > missed when I wrote the HDMI PHY fix
> > (c49d005b6cc8491fad5b24f82805be2d6bcbd3dd).
> 
> Merged. You would add
> Cc: stable@vger.kernel.org
> to patches if appropriate?

Thanks. Yes, I have sent a separate mail to stable list, as the patches
needed some tuning to apply.

 Tomi


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH] udlfb: Fix invalid return codes in edid sysfs entry store function
From: Florian Tobias Schandinat @ 2012-02-28 16:14 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1329983601-25335-1-git-send-email-olivier@sobrie.be>

[Cc'ing Bernie Thompson, the udlfb maintainer]
@Bernie: Why don't you add an entry for it in MAINTAINERS?

On 02/23/2012 07:53 AM, Olivier Sobrie wrote:
> Return a negative errno instead of zero in the write function of
> the sysfs entry in case of error.
> Also add a check on the return value of dlfb_setup_modes().
> 
> Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
> ---
>  drivers/video/udlfb.c |    9 ++++++---
>  1 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
> index a197731..abbc3fe 100644
> --- a/drivers/video/udlfb.c
> +++ b/drivers/video/udlfb.c
> @@ -1427,19 +1427,22 @@ static ssize_t edid_store(
>  	struct device *fbdev = container_of(kobj, struct device, kobj);
>  	struct fb_info *fb_info = dev_get_drvdata(fbdev);
>  	struct dlfb_data *dev = fb_info->par;
> +	int ret;
>  
>  	/* We only support write of entire EDID at once, no offset*/
>  	if ((src_size != EDID_LENGTH) || (src_off != 0))
> -		return 0;
> +		return -EINVAL;
>  
> -	dlfb_setup_modes(dev, fb_info, src, src_size);
> +	ret = dlfb_setup_modes(dev, fb_info, src, src_size);
> +	if (ret)
> +		return ret;
>  
>  	if (dev->edid && (memcmp(src, dev->edid, src_size) = 0)) {
>  		pr_info("sysfs written EDID is new default\n");
>  		dlfb_ops_set_par(fb_info);
>  		return src_size;
>  	} else
> -		return 0;
> +		return -EINVAL;
>  }
>  
>  static ssize_t metrics_reset_store(struct device *fbdev,


^ permalink raw reply

* RE: [GIT PULL] OMAP DSS fixes for 3.3-rc
From: Jingoo Han @ 2012-02-29  1:18 UTC (permalink / raw)
  To: 'Florian Tobias Schandinat', 'Tomi Valkeinen'
  Cc: linux-fbdev, 'linux-omap mailing list'
In-Reply-To: <4F4CFAD1.1000301@gmx.de>

Hi.
> -----Original Message-----
> From: linux-fbdev-owner@vger.kernel.org [mailto:linux-fbdev-owner@vger.kernel.org] On Behalf Of Florian
> Tobias Schandinat
> Sent: Wednesday, February 29, 2012 1:03 AM
> To: Tomi Valkeinen
> Cc: linux-fbdev@vger.kernel.org; linux-omap mailing list
> Subject: Re: [GIT PULL] OMAP DSS fixes for 3.3-rc
> 
> On 02/23/2012 09:22 AM, Tomi Valkeinen wrote:
> > Hi Florian,
> >
> > Two fixes for OMAP DSS for 3.3:
> >
> > First one gets the HDMI output working again. Managing the clocks for
> > OMAP4 is not very simple, and this patch circumvents the problems we
> > have in the clock framework. It's a clean but rather hacky fix, but it
> > shouldn't cause any side-effects. The issue will hopefully be fixed
> > properly with DT when we'll get proper parent-child hierarchy for DSS HW
> > submodules.
> >
> > The second one is a simple fix for HDMI hotplug detection, which I
> > missed when I wrote the HDMI PHY fix
> > (c49d005b6cc8491fad5b24f82805be2d6bcbd3dd).
> 
> Merged. You would add
> Cc: stable@vger.kernel.org
> to patches if appropriate?

I agree on Florian's opinion.
It would be good to add this patch to stable kernel. :)

> 
> 
> Thanks,
> 
> Florian Tobias Schandinat
> 
> >
> >  Tomi
> >
> > The following changes since commit d65b4e98d7ea3038b767b70fe8be959b2913f16d:
> >
> >   Linux 3.3-rc3 (2012-02-08 19:21:53 -0800)
> >
> > are available in the git repository at:
> >   git://gitorious.org/linux-omap-dss2/linux.git for-3.3-rc
> >
> > Archit Taneja (1):
> >       OMAPDSS: HACK: Ensure DSS clock domain gets out of idle when HDMI is enabled
> >
> > Rob Clark (1):
> >       OMAPDSS: HDMI: hot plug detect fix
> >
> >  drivers/video/omap2/dss/hdmi.c            |   24 +++++++++++++++++++++++-
> >  drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c |    9 +--------
> >  2 files changed, 24 insertions(+), 9 deletions(-)
> >
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply

* RE: [PATCH] udlfb: Fix invalid return codes in edid sysfs entry store function
From: Jingoo Han @ 2012-02-29  1:33 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1329983601-25335-1-git-send-email-olivier@sobrie.be>


Hi.
> -----Original Message-----
> From: linux-fbdev-owner@vger.kernel.org [mailto:linux-fbdev-owner@vger.kernel.org] On Behalf Of Florian
> Tobias Schandinat
> Sent: Wednesday, February 29, 2012 1:14 AM
> To: Olivier Sobrie
> Cc: linux-fbdev@vger.kernel.org; Bernie Thompson
> Subject: Re: [PATCH] udlfb: Fix invalid return codes in edid sysfs entry store function
> 
> [Cc'ing Bernie Thompson, the udlfb maintainer]
> @Bernie: Why don't you add an entry for it in MAINTAINERS?

I think so, too. :)
Bernie, it would be good to add you to MAINTAINERS as udlfb maintainer.

> 
> On 02/23/2012 07:53 AM, Olivier Sobrie wrote:
> > Return a negative errno instead of zero in the write function of
> > the sysfs entry in case of error.
> > Also add a check on the return value of dlfb_setup_modes().
> >
> > Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
> > ---
> >  drivers/video/udlfb.c |    9 ++++++---
> >  1 files changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
> > index a197731..abbc3fe 100644
> > --- a/drivers/video/udlfb.c
> > +++ b/drivers/video/udlfb.c
> > @@ -1427,19 +1427,22 @@ static ssize_t edid_store(
> >  	struct device *fbdev = container_of(kobj, struct device, kobj);
> >  	struct fb_info *fb_info = dev_get_drvdata(fbdev);
> >  	struct dlfb_data *dev = fb_info->par;
> > +	int ret;
> >
> >  	/* We only support write of entire EDID at once, no offset*/
> >  	if ((src_size != EDID_LENGTH) || (src_off != 0))
> > -		return 0;
> > +		return -EINVAL;
> >
> > -	dlfb_setup_modes(dev, fb_info, src, src_size);
> > +	ret = dlfb_setup_modes(dev, fb_info, src, src_size);
> > +	if (ret)
> > +		return ret;
> >
> >  	if (dev->edid && (memcmp(src, dev->edid, src_size) = 0)) {
> >  		pr_info("sysfs written EDID is new default\n");
> >  		dlfb_ops_set_par(fb_info);
> >  		return src_size;
> >  	} else
> > -		return 0;
> > +		return -EINVAL;
How about this? According to the coding style, it is more desirable to use braces.
Sorry for nitpicking. :)
 -  	} else
 -		return 0;
 +  	} else {
 +		return -EINVAL;
 +	}
> >  }
> >
> >  static ssize_t metrics_reset_store(struct device *fbdev,
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply

* RE: [GIT PULL] OMAP DSS fixes for 3.3-rc
From: Jingoo Han @ 2012-02-29  1:42 UTC (permalink / raw)
  To: 'Tomi Valkeinen', 'Florian Tobias Schandinat'
  Cc: linux-fbdev, 'linux-omap mailing list'
In-Reply-To: <1330445287.2123.236.camel@deskari>


> -----Original Message-----
> From: linux-fbdev-owner@vger.kernel.org [mailto:linux-fbdev-owner@vger.kernel.org] On Behalf Of Tomi
> Valkeinen
> Sent: Wednesday, February 29, 2012 1:08 AM
> To: Florian Tobias Schandinat
> Cc: linux-fbdev@vger.kernel.org; linux-omap mailing list
> Subject: Re: [GIT PULL] OMAP DSS fixes for 3.3-rc
> 
> On Tue, 2012-02-28 at 16:03 +0000, Florian Tobias Schandinat wrote:
> > On 02/23/2012 09:22 AM, Tomi Valkeinen wrote:
> > > Hi Florian,
> > >
> > > Two fixes for OMAP DSS for 3.3:
> > >
> > > First one gets the HDMI output working again. Managing the clocks for
> > > OMAP4 is not very simple, and this patch circumvents the problems we
> > > have in the clock framework. It's a clean but rather hacky fix, but it
> > > shouldn't cause any side-effects. The issue will hopefully be fixed
> > > properly with DT when we'll get proper parent-child hierarchy for DSS HW
> > > submodules.
> > >
> > > The second one is a simple fix for HDMI hotplug detection, which I
> > > missed when I wrote the HDMI PHY fix
> > > (c49d005b6cc8491fad5b24f82805be2d6bcbd3dd).
> >
> > Merged. You would add
> > Cc: stable@vger.kernel.org
> > to patches if appropriate?
> 
> Thanks. Yes, I have sent a separate mail to stable list, as the patches
> needed some tuning to apply.

Tomi, sorry.
You have already sent a mail to stable@vger.kernel.org.
Good luck.

Best regards,
Jingoo Han
> 
>  Tomi


^ permalink raw reply

* [PATCH v2] udlfb: Fix invalid return codes in edid sysfs entry store function
From: Olivier Sobrie @ 2012-02-29  7:06 UTC (permalink / raw)
  To: linux-fbdev

Return a negative errno instead of zero in the write function of
the sysfs entry in case of error.
Also add a check on the return value of dlfb_setup_modes().

Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
---
 drivers/video/udlfb.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
index a197731..bfd2a56 100644
--- a/drivers/video/udlfb.c
+++ b/drivers/video/udlfb.c
@@ -1427,19 +1427,22 @@ static ssize_t edid_store(
 	struct device *fbdev = container_of(kobj, struct device, kobj);
 	struct fb_info *fb_info = dev_get_drvdata(fbdev);
 	struct dlfb_data *dev = fb_info->par;
+	int ret;
 
 	/* We only support write of entire EDID at once, no offset*/
 	if ((src_size != EDID_LENGTH) || (src_off != 0))
-		return 0;
+		return -EINVAL;
 
-	dlfb_setup_modes(dev, fb_info, src, src_size);
+	ret = dlfb_setup_modes(dev, fb_info, src, src_size);
+	if (ret)
+		return ret;
 
-	if (dev->edid && (memcmp(src, dev->edid, src_size) = 0)) {
-		pr_info("sysfs written EDID is new default\n");
-		dlfb_ops_set_par(fb_info);
-		return src_size;
-	} else
-		return 0;
+	if (!dev->edid || memcmp(src, dev->edid, src_size))
+		return -EINVAL;
+
+	pr_info("sysfs written EDID is new default\n");
+	dlfb_ops_set_par(fb_info);
+	return src_size;
 }
 
 static ssize_t metrics_reset_store(struct device *fbdev,
-- 
1.7.5.4


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox