* [PATCH 01/27] OMAP: change get_context_loss_count ret value to int
From: Tomi Valkeinen @ 2011-06-03 10:00 UTC (permalink / raw)
To: linux-omap, linux-fbdev; +Cc: b-cousson, paul, khilman, Tomi Valkeinen
In-Reply-To: <1307095237-14805-1-git-send-email-tomi.valkeinen@ti.com>
get_context_loss_count functions return context loss count as u32, and
zero means an error. However, zero is also returned when context has
never been lost and could also be returned when the context loss count
has wrapped and goes to zero.
Change the functions to return an int, with negative value meaning an
error.
OMAP HSMMC code uses omap_pm_get_dev_context_loss_count(), but as the
hsmmc code handles the returned value as an int, with negative value
meaning an error, this patch actually fixes hsmmc code also.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Kevin Hilman <khilman@ti.com>
---
arch/arm/mach-omap2/omap_hwmod.c | 2 +-
arch/arm/mach-omap2/powerdomain.c | 14 ++++++++++----
arch/arm/mach-omap2/powerdomain.h | 2 +-
arch/arm/plat-omap/include/plat/omap-pm.h | 4 ++--
arch/arm/plat-omap/include/plat/omap_device.h | 2 +-
arch/arm/plat-omap/include/plat/omap_hwmod.h | 2 +-
arch/arm/plat-omap/omap-pm-noop.c | 24 +++++++++++++++++-------
arch/arm/plat-omap/omap_device.c | 2 +-
8 files changed, 34 insertions(+), 18 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index e034294..4f0d554 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2332,7 +2332,7 @@ ohsps_unlock:
* Returns the context loss count of the powerdomain assocated with @oh
* upon success, or zero if no powerdomain exists for @oh.
*/
-u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh)
+int omap_hwmod_get_context_loss_count(struct omap_hwmod *oh)
{
struct powerdomain *pwrdm;
int ret = 0;
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 9af0847..9d53a34 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -935,16 +935,16 @@ int pwrdm_post_transition(void)
* @pwrdm: struct powerdomain * to wait for
*
* Context loss count is the sum of powerdomain off-mode counter, the
- * logic off counter and the per-bank memory off counter. Returns 0
+ * logic off counter and the per-bank memory off counter. Returns negative
* (and WARNs) upon error, otherwise, returns the context loss count.
*/
-u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm)
+int pwrdm_get_context_loss_count(struct powerdomain *pwrdm)
{
int i, count;
if (!pwrdm) {
WARN(1, "powerdomain: %s: pwrdm is null\n", __func__);
- return 0;
+ return -ENODEV;
}
count = pwrdm->state_counter[PWRDM_POWER_OFF];
@@ -953,7 +953,13 @@ u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm)
for (i = 0; i < pwrdm->banks; i++)
count += pwrdm->ret_mem_off_counter[i];
- pr_debug("powerdomain: %s: context loss count = %u\n",
+ /*
+ * Context loss count has to be a non-negative value. Clear the sign
+ * bit to get a value range from 0 to INT_MAX.
+ */
+ count &= INT_MAX;
+
+ pr_debug("powerdomain: %s: context loss count = %d\n",
pwrdm->name, count);
return count;
diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h
index d23d979..012827f 100644
--- a/arch/arm/mach-omap2/powerdomain.h
+++ b/arch/arm/mach-omap2/powerdomain.h
@@ -207,7 +207,7 @@ int pwrdm_clkdm_state_switch(struct clockdomain *clkdm);
int pwrdm_pre_transition(void);
int pwrdm_post_transition(void);
int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm);
-u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm);
+int pwrdm_get_context_loss_count(struct powerdomain *pwrdm);
bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm);
extern void omap2xxx_powerdomains_init(void);
diff --git a/arch/arm/plat-omap/include/plat/omap-pm.h b/arch/arm/plat-omap/include/plat/omap-pm.h
index c0a7520..68df031 100644
--- a/arch/arm/plat-omap/include/plat/omap-pm.h
+++ b/arch/arm/plat-omap/include/plat/omap-pm.h
@@ -350,9 +350,9 @@ unsigned long omap_pm_cpu_get_freq(void);
* driver must restore device context. If the number of context losses
* exceeds the maximum positive integer, the function will wrap to 0 and
* continue counting. Returns the number of context losses for this device,
- * or zero upon error.
+ * or negative value upon error.
*/
-u32 omap_pm_get_dev_context_loss_count(struct device *dev);
+int omap_pm_get_dev_context_loss_count(struct device *dev);
void omap_pm_enable_off_mode(void);
void omap_pm_disable_off_mode(void);
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
index e4c349f..70d31d0 100644
--- a/arch/arm/plat-omap/include/plat/omap_device.h
+++ b/arch/arm/plat-omap/include/plat/omap_device.h
@@ -107,7 +107,7 @@ void __iomem *omap_device_get_rt_va(struct omap_device *od);
int omap_device_align_pm_lat(struct platform_device *pdev,
u32 new_wakeup_lat_limit);
struct powerdomain *omap_device_get_pwrdm(struct omap_device *od);
-u32 omap_device_get_context_loss_count(struct platform_device *pdev);
+int omap_device_get_context_loss_count(struct platform_device *pdev);
/* Other */
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 1adea9c..8658e2d 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -598,7 +598,7 @@ int omap_hwmod_for_each_by_class(const char *classname,
void *user);
int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
-u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
+int omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
diff --git a/arch/arm/plat-omap/omap-pm-noop.c b/arch/arm/plat-omap/omap-pm-noop.c
index b0471bb2..3dc3801 100644
--- a/arch/arm/plat-omap/omap-pm-noop.c
+++ b/arch/arm/plat-omap/omap-pm-noop.c
@@ -27,7 +27,7 @@
#include <plat/omap_device.h>
static bool off_mode_enabled;
-static u32 dummy_context_loss_counter;
+static int dummy_context_loss_counter;
/*
* Device-driver-originated constraints (via board-*.c files)
@@ -311,22 +311,32 @@ void omap_pm_disable_off_mode(void)
#ifdef CONFIG_ARCH_OMAP2PLUS
-u32 omap_pm_get_dev_context_loss_count(struct device *dev)
+int omap_pm_get_dev_context_loss_count(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
- u32 count;
+ int count;
if (WARN_ON(!dev))
- return 0;
+ return -ENODEV;
if (dev->parent = &omap_device_parent) {
count = omap_device_get_context_loss_count(pdev);
} else {
WARN_ONCE(off_mode_enabled, "omap_pm: using dummy context loss counter; device %s should be converted to omap_device",
dev_name(dev));
- if (off_mode_enabled)
- dummy_context_loss_counter++;
+
count = dummy_context_loss_counter;
+
+ if (off_mode_enabled) {
+ count++;
+ /*
+ * Context loss count has to be a non-negative value.
+ * Clear the sign bit to get a value range from 0 to
+ * INT_MAX.
+ */
+ count &= INT_MAX;
+ dummy_context_loss_counter = count;
+ }
}
pr_debug("OMAP PM: context loss count for dev %s = %d\n",
@@ -337,7 +347,7 @@ u32 omap_pm_get_dev_context_loss_count(struct device *dev)
#else
-u32 omap_pm_get_dev_context_loss_count(struct device *dev)
+int omap_pm_get_dev_context_loss_count(struct device *dev)
{
return dummy_context_loss_counter;
}
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index 9bbda9a..9753f71 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -310,7 +310,7 @@ static void _add_optional_clock_clkdev(struct omap_device *od,
* return the context loss counter for that hwmod, otherwise return
* zero.
*/
-u32 omap_device_get_context_loss_count(struct platform_device *pdev)
+int omap_device_get_context_loss_count(struct platform_device *pdev)
{
struct omap_device *od;
u32 ret = 0;
--
1.7.4.1
^ permalink raw reply related
* [PATCH 00/27] OMAP DSS runtime PM adaptation
From: Tomi Valkeinen @ 2011-06-03 10:00 UTC (permalink / raw)
To: linux-omap, linux-fbdev; +Cc: b-cousson, paul, khilman, Tomi Valkeinen
Hi,
This patch set implements runtime PM adaptation for OMAP DSS driver.
The bulk of the code is in the "OMAP: DSS2: Use PM runtime & HWMOD support"
patch, which is a bit too large for comfort, but I haven't found out ways to
split it up.
All DSS HW modules now handle enabling and disabling of the HW block
independently via pm_runtime calls. Some DSS modules also require other DSS
modules, and for that we have functions like dispc_runtime_get/put() which can
be used to enable that module.
Due to DSS' peculiar clock setup the code is not as elegant as I'd like. The
problem is that on OMAP4 we have to enable an optional clock before calling
pm_runtime_get(), and similarly we need to keep the optional clock enabled
until after pm_runtime_put() has been called.
This causes some extra complications. For example, we can't use runtime_resume
callback to enable the opt clocks, as they are required before calling
pm_runtime_get().
Previously DSS driver did reset the HW every time before taking it into use.
This can no longer be done, as HWMOD framework handles the reset. While the
driver works without resetting the HW, an error could render the HW inoperable
and currently the driver may not be able to recover. So these patches may make
the driver more unreliable on error cases.
If a way to reset the HWMOD is added to the HWMOD framework, DSS driver can
take it into use and the above mentioned problem should go away.
Tested on OMAP4 Blaze, OMAP3 Overo, OMAP2420 N800. (However, N800 needs extra
patches to get it and DSS2 running, can be found from n800 branch in my tree).
These patches can be found from:
git://gitorious.org/linux-omap-dss2/linux.git pmruntime
Tomi
Tomi Valkeinen (27):
OMAP: change get_context_loss_count ret value to int
OMAP: DSS2: Taal: Make driver more fault tolerant
OMAP: DSS2: Reset LANEx_ULPS_SIG2 bits after use
OMAP: DSS2: Handle dpll4_m4_ck in dss_get/put_clocks
OMAP: DSS2: Clean up probe for DSS & DSI
OMAP: DSS2: Init dispc first before other components
OMAP: DSS2: Remove clk optimization at dss init
OMAP: DSS2: rewrite use of context_loss_count
OMAP: DSS2: Use omap_pm_get_dev_context_loss_count to get ctx loss
count
OMAP: DSS2: DPI: remove unneeded SYSCK enable/disable
OMAP: DSS2: Add FEAT_VENC_REQUIRES_TV_DAC_CLK
OMAP: DSS2: Add new FEAT definitions for features missing from OMAP2
OMAP: DSS2: Remove core_dump_clocks
OMAP: DSS2: Remove CONFIG_OMAP2_DSS_SLEEP_BEFORE_RESET
OMAP4: HWMOD: Modify DSS opt clocks
OMAP3: HWMOD: Add DSS opt clocks
OMAP2420: HWMOD: Add DSS opt clocks
OMAP2430: HWMOD: Add DSS opt clocks
OMAP: DSS2: Use PM runtime & HWMOD support
OMAP4: HWMOD: Remove unneeded DSS opt clocks
OMAP: DSS2: Remove unused opt_clock_available
OMAP: DSS2: DISPC: remove finegrained clk enables/disables
OMAP: DSS2: Remove unused code from display.c
OMAP: DSS2: Remove ctx loss count from dss.c
OMAP4: CLKDEV: Remove omapdss clock aliases
OMAP: DSS2: DISPC: Fix context save/restore
OMAP: DSS2: DSS: Fix context save/restore
arch/arm/mach-omap2/clock44xx_data.c | 10 +-
arch/arm/mach-omap2/display.c | 26 +-
arch/arm/mach-omap2/omap_hwmod.c | 2 +-
arch/arm/mach-omap2/omap_hwmod_2420_data.c | 19 +
arch/arm/mach-omap2/omap_hwmod_2430_data.c | 19 +
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 37 ++-
arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 43 ++-
arch/arm/mach-omap2/powerdomain.c | 14 +-
arch/arm/mach-omap2/powerdomain.h | 2 +-
arch/arm/plat-omap/include/plat/omap-pm.h | 4 +-
arch/arm/plat-omap/include/plat/omap_device.h | 2 +-
arch/arm/plat-omap/include/plat/omap_hwmod.h | 2 +-
arch/arm/plat-omap/omap-pm-noop.c | 24 +-
arch/arm/plat-omap/omap_device.c | 2 +-
drivers/video/omap2/displays/panel-taal.c | 33 +-
drivers/video/omap2/dss/Kconfig | 12 -
drivers/video/omap2/dss/core.c | 15 +-
drivers/video/omap2/dss/dispc.c | 496 ++++++++++++----------
drivers/video/omap2/dss/dpi.c | 73 ++--
drivers/video/omap2/dss/dsi.c | 284 ++++++++-----
drivers/video/omap2/dss/dss.c | 564 ++++++-------------------
drivers/video/omap2/dss/dss.h | 34 +-
drivers/video/omap2/dss/dss_features.c | 13 +-
drivers/video/omap2/dss/dss_features.h | 4 +
drivers/video/omap2/dss/hdmi.c | 149 +++++--
drivers/video/omap2/dss/manager.c | 8 +-
drivers/video/omap2/dss/overlay.c | 27 +-
drivers/video/omap2/dss/rfbi.c | 97 ++++-
drivers/video/omap2/dss/sdi.c | 40 ++-
drivers/video/omap2/dss/venc.c | 171 +++++++-
include/video/omapdss.h | 4 +-
31 files changed, 1207 insertions(+), 1023 deletions(-)
--
1.7.4.1
^ permalink raw reply
* Re: [PATCH 21/29] s3fb: use display information in info not in var
From: Tormod Volden @ 2011-06-03 9:26 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1306364301-8195-22-git-send-email-laurent.pinchart@ideasonboard.com>
On Thu, May 26, 2011 at 6:31 PM, Laurent Pinchart wrote:
> On Thursday 26 May 2011 16:12:21 Tormod Volden wrote:
>> On Thu, May 26, 2011 at 12:58 AM, Laurent Pinchart wrote:
>> > We must not use any information in the passed var besides xoffset,
>> > yoffset and vmode as otherwise applications might abuse it. Also use the
>> > aligned fix.line_length and not the (possible) unaligned xres_virtual.
>> >
>> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> > Cc: Antonino Daplas <adaplas@gmail.com>
>> > ---
>> > drivers/video/savage/savagefb_driver.c | 16 +++++++---------
>> > 1 files changed, 7 insertions(+), 9 deletions(-)
>>
>> The patch title is misleading, this is not the s3fb driver but the
>> savagefb driver.
>
> Yes, sorry about that. I've fixed the patch title, as well as the next patch.
Hi Laurent,
I haven't seen any updated patch posted, but anyway, the patch looks
otherwise correct to me, and I have tested it on my Savage TwisterK:
Reviewed-by: Tormod Volden <debian.tormod@gmail.com>
Cheers,
Tormod
^ permalink raw reply
* Re: [Patch 1/2] Fix use-after-free by vga16fb on rmmod
From: Bruno Prémont @ 2011-06-02 18:18 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <20110524215917.4b01df45@neptune.home>
Hi Paul,
On Tue, 24 May 2011 Bruno Prémont <bonbons@linux-vserver.org> wrote:
> Since fb_info is now refcounted and thus may get freed at any time it
> gets unregistered module unloading will try to unregister framebuffer
> as stored in platform data on probe though this pointer may
> be stale.
>
> Cleanup platform data on framebuffer release.
>
> CC: stable@kernel.org
> Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
> ---
> This should also go into 2.6.39 stable as it didn't make it into 2.6.39
> with the rest of fb_info refcounting work.
>
> This comes from
> [2.6.39-rc2, framebuffer] use after free oops
> ...
> [PATCH 0/2] fbcon sanity
> thread
Any chance of applying these two patches?
I've had no feedback from you on them and they don't show up in your tree.
Bruno
^ permalink raw reply
* Re: [PATCH 0/4] efifb speedup and fixes
From: Peter Jones @ 2011-06-02 17:04 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <cover.1306418703.git.luto@mit.edu>
>> Andy Lutomirski (4):
>> efifb: Enable write-combining
>> efifb: Fix mismatched request/release_mem_region
>> efifb: Fix an integer-to-pointer size warning
>> efifb: Disallow manual bind and unbind
>>
> I've applied patches 1, 2, and 4 along with Peter's sign off. I've not
> added a stable cc since neither were specifically regressions, so I'll
> just let Greg naturally decide whether to take them or not.
Thanks, Paul.
--
Peter
^ permalink raw reply
* Re: [TRIVIAL PATCH V2 next 12/15] video: Convert vmalloc/memset to vzalloc
From: Paul Mundt @ 2011-06-02 8:26 UTC (permalink / raw)
To: Joe Perches
Cc: Heiko St?bner, Jaya Kumar, Jeremy Fitzhardinge,
Konrad Rzeszutek Wilk, Jiri Kosina, linux-fbdev, linux-kernel,
xen-devel, virtualization
In-Reply-To: <1306606413.20336.9.camel@Joe-Laptop>
On Sat, May 28, 2011 at 11:13:33AM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> Heiko St??bner <heiko@sntech.de> pointed out I can't type...
> s/vmalloc/vmalloc/ doesn't do much.
>
> drivers/video/arcfb.c | 5 ++---
> drivers/video/broadsheetfb.c | 4 +---
> drivers/video/hecubafb.c | 5 ++---
> drivers/video/metronomefb.c | 4 +---
> drivers/video/xen-fbfront.c | 3 +--
> 5 files changed, 7 insertions(+), 14 deletions(-)
>
v2 applied.
^ permalink raw reply
* Re: [PATCH 0/4] efifb speedup and fixes
From: Paul Mundt @ 2011-06-02 8:20 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <cover.1306418703.git.luto@mit.edu>
On Thu, May 26, 2011 at 10:13:30AM -0400, Andy Lutomirski wrote:
> Fbcon over efifb is so slow that I thought I needed a faster modem.
> It turns out that scrolling boot messages at 1024x768 pixels with
> uncached accesses can take longer than every other step of kernel
> bootup *combined*.
>
> Fixing it is a one-liner, but I found some bugs while I was digging
> around. One is a mismatched resource release (although not on my
> box), one is a harmless compiler warning, and one fixes all manner of
> badness that happens if you manually bind or unbind the efifb driver.
>
> The speedup may or may not be 2.6.40 material, but the other fixes
> should probably go in. (2/4 and 4/4 are possibly -stable candidates.)
>
> Andy Lutomirski (4):
> efifb: Enable write-combining
> efifb: Fix mismatched request/release_mem_region
> efifb: Fix an integer-to-pointer size warning
> efifb: Disallow manual bind and unbind
>
I've applied patches 1, 2, and 4 along with Peter's sign off. I've not
added a stable cc since neither were specifically regressions, so I'll
just let Greg naturally decide whether to take them or not.
^ permalink raw reply
* Re: [PATCH] savagefb: Use panel CVT mode as default
From: Paul Mundt @ 2011-06-02 8:15 UTC (permalink / raw)
To: linux-fbdev
On Sat, May 28, 2011 at 05:06:11PM +0200, Tormod Volden wrote:
> From: Tormod Volden <debian.tormod@gmail.com>
>
> If there is no EDID but an LCD panel is detected, generate a CVT
> mode from the panel resolution (at 60 Hz), and use this as a
> default mode instead of the hardcoded 800x600x8 mode.
>
> Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] fbdev: bf537-lq035: add missing blacklight properties type
From: Paul Mundt @ 2011-06-02 8:13 UTC (permalink / raw)
To: linux-fbdev
On Sun, May 29, 2011 at 11:23:36PM -0400, Mike Frysinger wrote:
> From: Steven Miao <realmz6@gmail.com>
>
> Seems this new field was missed, probably due to this driver being merged
> around the time this new backlight field was being added. At any rate,
> initial the type field to avoid ugly WARN() dumps.
>
> Signed-off-by: Steven Miao <realmz6@gmail.com>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH 8/10] drivers/video/imxfb.c: add missing clk_put
From: Paul Mundt @ 2011-06-02 8:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1306948213-20767-8-git-send-email-julia@diku.dk>
On Wed, Jun 01, 2011 at 07:10:11PM +0200, Julia Lawall wrote:
> drivers/video/imxfb.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
On Wed, Jun 01, 2011 at 07:10:13PM +0200, Julia Lawall wrote:
> drivers/video/pxa168fb.c | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
Both applied, thanks.
^ permalink raw reply
* Re: Mirror "module" for framebuffer
From: Daniele Salvatore Albano @ 2011-06-01 20:37 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <4DE67493.6090708@daccii.it>
Il 01/06/2011 22:02, Bruno Prémont ha scritto:
> Hi,
>
> [re-adding linux-fbdev, please make sure to reply-to-all]
uops
> Note that some framebuffer drivers might implement (lots) of private
> ioctls to implement (accelerated) drawing primitives.
> So unless you know the driver you are hooking onto all bets are open.
.
.
.
> No, only a few selected ones implement deferred input/output, usually
> because the real framebuffer cannot be mapped into memory or the link
> to it is just dead slow so changes are pushed down to device at regular
> intervals.
.
.
.
> I'm wondering if you not better had to create a new framebuffer driver
> (based on virtual framebuffer) with fbdefio to push the changes to a
> backing framebuffer [the way fbcon draws console] (as well as whatever you
> use to stream to the remote system).
> This will make you lose any potential hardware acceleration but keep
> things simple.
> Though you would need ability to move software to your new framebuffer.
Main problem is that i need to show what is being displayed on the
screen, so i can't use another framebuffer device but i must use the one
used by the os.
mmm i think that isin't the right way to handle this situation because
this software should work with too much different (and untestable) hardware.
I'll see if there is a way to check when android draw something on the
framebuffer
Thanks a lot for your time!
Best Regards,
Daniele
--
____________________________________________________________
|
Daniele Salvatore Albano | web site:
IT Consultant | http://www.itechcon.it
Website Design and Development |
Software Engineer and Developer | e-mail:
Linux Servers SetUp And Administration | info@itechcon.it
Embedded Network Solutions | d.albano@itechcon.it
Are you lazy? Take a look to LazyDroid (www.lazydroid.net): android for
lazy people!
Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute in
questo messaggio sono riservate ed a uso esclusivo del destinatario.
Qualora il messaggio in parola Le fosse pervenuto per errore, La
invitiamo ad eliminarlo senza copiarlo e a non inoltrarlo a terzi,
dandocene gentilmente comunicazione. Grazie.
Pursuant to Legislative Decree No. 196/2003, you are hereby informed
that this message contains confidential information intended only for
the use of the addressee. If you are not the addressee, and have
received this message by mistake, please delete it and immediately
notify us. You may not copy or disseminate this message to anyone. Thank
you.
^ permalink raw reply
* Framebuffer Documentation
From: Erlon Cruz @ 2011-06-01 20:27 UTC (permalink / raw)
To: linux-fbdev
Hi all,
Im starting a project to develop a frame-buffer but I know anything
about framebuffers. :) ... well do you guys have any suggestion about
documentation or books (even though very hight level) about
frame-buffers that could help me understand what goes around FBs
drivers and devices??
Regards,
Erlon
^ permalink raw reply
* Re: Mirror "module" for framebuffer
From: Bruno Prémont @ 2011-06-01 20:02 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <4DE67493.6090708@daccii.it>
Hi,
[re-adding linux-fbdev, please make sure to reply-to-all]
On Wed, 01 June 2011 Daniele Salvatore Albano <info@daccii.it> wrote:
> From what i understand, technically i should hook registered
> framebuffer and change the callback (info->fbdefio->deferred_io),
> restoring it on module unloading to avoid the caos.
>
> In this way i could "catch" updates passed to the pagelist argument of
> the deferred io callback, add them to an own list, and call the original
> callback to let the driver to do the own work.
Note that some framebuffer drivers might implement (lots) of private
ioctls to implement (accelerated) drawing primitives.
So unless you know the driver you are hooking onto all bets are open.
> This is in the kernel from 2.6.20, so it should be on phone kernel.
>
> I've a couple more questions:
> - i need to access the structure containing the list of registered
> framebuffer device (struct fb_info *registered_fb[FB_MAX]), i've seen
> that there is an export symbol on registered_fb so can i access that
> directly/num_registered_fb?
You can access it (as does fbcon) though that direct access may/will
go away in the future as (since 2.6.39) now that array is protected
by a mutex on fb core side (fbcon being indirectly fine through its
synchronization via notification events, except when loading fbcon
module)
If you do access the list, write an function to do just that
so there is no big rewrite needed to move your driver forward.
> - i need to know when a framebuffer is registered, i've seen that there
> is fb_register_client ... from what i see it seems that callback are
> called on every event so from the callback itself i should check for
> FB_EVENT_FB_REGISTERED, is this right?
If you want to know when framebuffers get (un)registered (or get
reconfigured) this is the way to go.
> - (stupid question) do all fb modules implement deferred input/output?
No, only a few selected ones implement deferred input/output, usually
because the real framebuffer cannot be mapped into memory or the link
to it is just dead slow so changes are pushed down to device at regular
intervals.
I'm wondering if you not better had to create a new framebuffer driver
(based on virtual framebuffer) with fbdefio to push the changes to a
backing framebuffer [the way fbcon draws console] (as well as whatever you
use to stream to the remote system).
This will make you lose any potential hardware acceleration but keep
things simple.
Though you would need ability to move software to your new framebuffer.
Bruno
^ permalink raw reply
* Re: Mirror "module" for framebuffer
From: Bruno Prémont @ 2011-06-01 18:43 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <4DE67493.6090708@daccii.it>
Hi Daniele,
On Wed, 01 June 2011 Daniele Salvatore Albano <info@daccii.it> wrote:
> In short i should start to work to an application to remote control an
> android phone, just using the browser (video stream plus a lot of
> javascript).
> While this is partially working right now, as you can imagine, phone is
> slow, a lot slow, so, while the framebuffer is little in most cases
> (320x256x2/320x256x4/800x480x2/800x480x4) a simple comparison, using
> neon extension too, if avaiable, is too slow, so the screen is refreshed
> too few times in a sec.
>
> On windows exists Mirror Drivers infrastructure that supply a list of
> changed parts of the screen and more (mouse events too if i'm not
> wrong), but looking around on the web i didn't founded anything related
> to this stuff (or similar) for linux.
>
> So, before i start scrambling docs and source code (i've really little
> experience with kernel module programming, i've done simply things), i
> want to ask a simple question: can be done using a sort of hooking of
> internal framebuffer function calls (fb_ops for example) or it's
> impossible because apps write directly into the framebuffer memory?
fbdefio probably is the nearest to what you are looking for.
It catches changes to the framebuffer (at page level) and calls back to
driver at regular intervals to react on those changes.
Though if your Andriod has some video HW acceleration you are going to
be lost here unless you can get change notification from the hardware
itself and then read back the changes.
Bruno
^ permalink raw reply
* Re: [PATCH 8/10] drivers/video/imxfb.c: add missing clk_put
From: Sascha Hauer @ 2011-06-01 17:49 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1306948213-20767-8-git-send-email-julia@diku.dk>
On Wed, Jun 01, 2011 at 07:10:11PM +0200, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
>
> Reorder the labels at the end of the function to correspond to the order in
> which the resources are allocated.
>
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @r exists@
> expression e1,e2;
> statement S;
> @@
>
> e1 = clk_get@p1(...);
> ... when != e1 = e2
> when != clk_put(e1)
> when any
> if (...) { ... when != clk_put(e1)
> when != if (...) { ... clk_put(e1) ... }
> * return@p3 ...;
> } else S
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
>
> ---
> drivers/video/imxfb.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
> index d2ccfd6..f135dbe 100644
> --- a/drivers/video/imxfb.c
> +++ b/drivers/video/imxfb.c
> @@ -856,10 +856,10 @@ failed_platform_init:
> dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu,
> fbi->map_dma);
> failed_map:
> - clk_put(fbi->clk);
> -failed_getclock:
> iounmap(fbi->regs);
> failed_ioremap:
> + clk_put(fbi->clk);
> +failed_getclock:
> release_mem_region(res->start, resource_size(res));
> failed_req:
> kfree(info->pseudo_palette);
>
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply
* Mirror "module" for framebuffer
From: Daniele Salvatore Albano @ 2011-06-01 17:19 UTC (permalink / raw)
To: linux-fbdev
Hi to all,
In short i should start to work to an application to remote control an
android phone, just using the browser (video stream plus a lot of
javascript).
While this is partially working right now, as you can imagine, phone is
slow, a lot slow, so, while the framebuffer is little in most cases
(320x256x2/320x256x4/800x480x2/800x480x4) a simple comparison, using
neon extension too, if avaiable, is too slow, so the screen is refreshed
too few times in a sec.
On windows exists Mirror Drivers infrastructure that supply a list of
changed parts of the screen and more (mouse events too if i'm not
wrong), but looking around on the web i didn't founded anything related
to this stuff (or similar) for linux.
So, before i start scrambling docs and source code (i've really little
experience with kernel module programming, i've done simply things), i
want to ask a simple question: can be done using a sort of hooking of
internal framebuffer function calls (fb_ops for example) or it's
impossible because apps write directly into the framebuffer memory?
Thank you!!!
Best Regards,
Daniele
--
____________________________________________________________
|
Daniele Salvatore Albano | web site:
IT Consultant | http://www.itechcon.it
Website Design and Development |
Software Engineer and Developer | e-mail:
Linux Servers SetUp And Administration | info@itechcon.it
Embedded Network Solutions | d.albano@itechcon.it
Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute in
questo messaggio sono riservate ed a uso esclusivo del destinatario.
Qualora il messaggio in parola Le fosse pervenuto per errore, La
invitiamo ad eliminarlo senza copiarlo e a non inoltrarlo a terzi,
dandocene gentilmente comunicazione. Grazie.
Pursuant to Legislative Decree No. 196/2003, you are hereby informed
that this message contains confidential information intended only for
the use of the addressee. If you are not the addressee, and have
received this message by mistake, please delete it and immediately
notify us. You may not copy or disseminate this message to anyone. Thank
you.
^ permalink raw reply
* [PATCH 10/10] drivers/video/pxa168fb.c: add missing clk_put
From: Julia Lawall @ 2011-06-01 17:10 UTC (permalink / raw)
To: Paul Mundt; +Cc: kernel-janitors, linux-fbdev, linux-kernel
From: Julia Lawall <julia@diku.dk>
Add a label for error-handling code in the case where only clk_get has
succeeded. Rename the label failed to be consistent with the rest.
A simplified version of the semantic match that finds the missing clk_put
is as follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r exists@
expression e1,e2;
statement S;
@@
e1 = clk_get@p1(...);
... when != e1 = e2
when != clk_put(e1)
when any
if (...) { ... when != clk_put(e1)
when != if (...) { ... clk_put(e1) ... }
* return@p3 ...;
} else S
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/video/pxa168fb.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c
index 35f61dd..bb95ec5 100644
--- a/drivers/video/pxa168fb.c
+++ b/drivers/video/pxa168fb.c
@@ -623,19 +623,21 @@ static int __devinit pxa168fb_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res = NULL) {
dev_err(&pdev->dev, "no IO memory defined\n");
- return -ENOENT;
+ ret = -ENOENT;
+ goto failed_put_clk;
}
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "no IRQ defined\n");
- return -ENOENT;
+ ret = -ENOENT;
+ goto failed_put_clk;
}
info = framebuffer_alloc(sizeof(struct pxa168fb_info), &pdev->dev);
if (info = NULL) {
- clk_put(clk);
- return -ENOMEM;
+ ret = -ENOMEM;
+ goto failed_put_clk;
}
/* Initialize private data */
@@ -671,7 +673,7 @@ static int __devinit pxa168fb_probe(struct platform_device *pdev)
fbi->reg_base = ioremap_nocache(res->start, resource_size(res));
if (fbi->reg_base = NULL) {
ret = -ENOMEM;
- goto failed;
+ goto failed_free_info;
}
/*
@@ -683,7 +685,7 @@ static int __devinit pxa168fb_probe(struct platform_device *pdev)
&fbi->fb_start_dma, GFP_KERNEL);
if (info->screen_base = NULL) {
ret = -ENOMEM;
- goto failed;
+ goto failed_free_info;
}
info->fix.smem_start = (unsigned long)fbi->fb_start_dma;
@@ -772,8 +774,9 @@ failed_free_clk:
failed_free_fbmem:
dma_free_coherent(fbi->dev, info->fix.smem_len,
info->screen_base, fbi->fb_start_dma);
-failed:
+failed_free_info:
kfree(info);
+failed_put_clk:
clk_put(clk);
dev_err(&pdev->dev, "frame buffer device init failed with %d\n", ret);
^ permalink raw reply related
* [PATCH 8/10] drivers/video/imxfb.c: add missing clk_put
From: Julia Lawall @ 2011-06-01 17:10 UTC (permalink / raw)
To: linux-arm-kernel
From: Julia Lawall <julia@diku.dk>
Reorder the labels at the end of the function to correspond to the order in
which the resources are allocated.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r exists@
expression e1,e2;
statement S;
@@
e1 = clk_get@p1(...);
... when != e1 = e2
when != clk_put(e1)
when any
if (...) { ... when != clk_put(e1)
when != if (...) { ... clk_put(e1) ... }
* return@p3 ...;
} else S
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/video/imxfb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index d2ccfd6..f135dbe 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -856,10 +856,10 @@ failed_platform_init:
dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu,
fbi->map_dma);
failed_map:
- clk_put(fbi->clk);
-failed_getclock:
iounmap(fbi->regs);
failed_ioremap:
+ clk_put(fbi->clk);
+failed_getclock:
release_mem_region(res->start, resource_size(res));
failed_req:
kfree(info->pseudo_palette);
^ permalink raw reply related
* Re: [TRIVIAL PATCH V2 next 12/15] video: Convert vmalloc/memset to
From: Konrad Rzeszutek Wilk @ 2011-05-31 14:28 UTC (permalink / raw)
To: Joe Perches
Cc: Heiko Stübner, Jaya Kumar, Paul Mundt, Jeremy Fitzhardinge,
Jiri Kosina, linux-fbdev, linux-kernel, xen-devel, virtualization
In-Reply-To: <1306606413.20336.9.camel@Joe-Laptop>
On Sat, May 28, 2011 at 11:13:33AM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> on the:
> diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
> index a20218c..beac52f 100644
> --- a/drivers/video/xen-fbfront.c
> +++ b/drivers/video/xen-fbfront.c
> @@ -395,10 +395,9 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
> spin_lock_init(&info->dirty_lock);
> spin_lock_init(&info->resize_lock);
>
> - info->fb = vmalloc(fb_size);
> + info->fb = vzalloc(fb_size);
> if (info->fb = NULL)
> goto error_nomem;
> - memset(info->fb, 0, fb_size);
>
> info->nr_pages = (fb_size + PAGE_SIZE - 1) >> PAGE_SHIFT;
^ permalink raw reply
* Re: [PATCH] fbdev: sh_mobile_lcdcfb: Change BGR24 to RGB24
From: Damian Hobson-Garcia @ 2011-05-31 3:28 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1306400942-26956-1-git-send-email-dhobsong@igel.co.jp>
Hi Magnus,
On 2011/05/27 17:14, Magnus Damm wrote:
> Hi Damian,
>
> On Thu, May 26, 2011 at 6:09 PM, Damian Hobson-Garcia
> <dhobsong@igel.co.jp> wrote:
>> The ordering of the bytes in the 24 bpp RGB colour mode was
>> being set to BGR.
>>
>> This now matches the values returned in the
>> struct fb_var_screeninfo .red, .green, and .blue offsets as well as
>> the output format of other blocs, such as the VEU
>>
>> Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
>> ---
>
> Thanks for your patch. With this change in place, is the fbdev console
> still working as expected?
>
> Also, the byte swap settings in _LDDDSR are ok as-is?
Actually, let me look into this a bit more. After thinking about it
some more there are one or two more things I want to check on this
first. Please ignore this patch for now. I'll resubmit it again once
its properly completed. Sorry for the mess.
Thanks,
Damian
^ permalink raw reply
* Re: [TRIVIAL PATCH next 12/15] video: Convert vmalloc/memset to
From: Mel Gorman @ 2011-05-30 11:40 UTC (permalink / raw)
To: Joe Perches
Cc: Jaya Kumar, Paul Mundt, Jeremy Fitzhardinge,
Konrad Rzeszutek Wilk, Jiri Kosina, linux-fbdev, xen-devel,
linux-kernel, virtualization
In-Reply-To: <77538de911b8af99f68b7bcfbaaedce8e40db04f.1306603968.git.joe@perches.com>
On Sat, May 28, 2011 at 10:36:32AM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/video/arcfb.c | 5 ++---
> drivers/video/broadsheetfb.c | 4 +---
> drivers/video/hecubafb.c | 5 ++---
> drivers/video/metronomefb.c | 4 +---
> drivers/video/xen-fbfront.c | 3 +--
> 5 files changed, 7 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
> index 3ec4923..86573e2 100644
> --- a/drivers/video/arcfb.c
> +++ b/drivers/video/arcfb.c
> @@ -515,11 +515,10 @@ static int __devinit arcfb_probe(struct platform_device *dev)
>
> /* We need a flat backing store for the Arc's
> less-flat actual paged framebuffer */
> - if (!(videomemory = vmalloc(videomemorysize)))
> + videomemory = vmalloc(videomemorysize);
> + if (!videomemory)
> return retval;
>
> - memset(videomemory, 0, videomemorysize);
> -
> info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev);
> if (!info)
> goto err;
This is the first commit I saw and stopped reading at this point
because this hunk is not using vzalloc. I imagine grep for ^+ and
vmalloc throughout the series would be helpful?
--
Mel Gorman
SUSE Labs
^ permalink raw reply
* [PATCH] fbdev: bf537-lq035: add missing blacklight properties type
From: Mike Frysinger @ 2011-05-30 3:23 UTC (permalink / raw)
To: linux-fbdev
From: Steven Miao <realmz6@gmail.com>
Seems this new field was missed, probably due to this driver being merged
around the time this new backlight field was being added. At any rate,
initial the type field to avoid ugly WARN() dumps.
Signed-off-by: Steven Miao <realmz6@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
drivers/video/bf537-lq035.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/video/bf537-lq035.c b/drivers/video/bf537-lq035.c
index 47c21fb..bea53c1 100644
--- a/drivers/video/bf537-lq035.c
+++ b/drivers/video/bf537-lq035.c
@@ -789,6 +789,7 @@ static int __devinit bfin_lq035_probe(struct platform_device *pdev)
i2c_add_driver(&ad5280_driver);
memset(&props, 0, sizeof(props));
+ props.type = BACKLIGHT_RAW;
props.max_brightness = MAX_BRIGHENESS;
bl_dev = backlight_device_register("bf537-bl", NULL, NULL,
&bfin_lq035fb_bl_ops, &props);
--
1.7.5.rc3
^ permalink raw reply related
* [TRIVIAL PATCH V2 next 12/15] video: Convert vmalloc/memset to
From: Joe Perches @ 2011-05-28 18:13 UTC (permalink / raw)
To: Heiko Stübner
Cc: Jaya Kumar, Paul Mundt, Jeremy Fitzhardinge,
Konrad Rzeszutek Wilk, Jiri Kosina, linux-fbdev, linux-kernel,
xen-devel, virtualization
In-Reply-To: <201105281948.12941.heiko@sntech.de>
Signed-off-by: Joe Perches <joe@perches.com>
---
Heiko Stübner <heiko@sntech.de> pointed out I can't type...
s/vmalloc/vmalloc/ doesn't do much.
drivers/video/arcfb.c | 5 ++---
drivers/video/broadsheetfb.c | 4 +---
drivers/video/hecubafb.c | 5 ++---
drivers/video/metronomefb.c | 4 +---
drivers/video/xen-fbfront.c | 3 +--
5 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index 3ec4923..86573e2 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -515,11 +515,10 @@ static int __devinit arcfb_probe(struct platform_device *dev)
/* We need a flat backing store for the Arc's
less-flat actual paged framebuffer */
- if (!(videomemory = vmalloc(videomemorysize)))
+ videomemory = vzalloc(videomemorysize);
+ if (!videomemory)
return retval;
- memset(videomemory, 0, videomemorysize);
-
info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev);
if (!info)
goto err;
diff --git a/drivers/video/broadsheetfb.c b/drivers/video/broadsheetfb.c
index ebda687..377dde3 100644
--- a/drivers/video/broadsheetfb.c
+++ b/drivers/video/broadsheetfb.c
@@ -1101,12 +1101,10 @@ static int __devinit broadsheetfb_probe(struct platform_device *dev)
videomemorysize = roundup((dpyw*dpyh), PAGE_SIZE);
- videomemory = vmalloc(videomemorysize);
+ videomemory = vzalloc(videomemorysize);
if (!videomemory)
goto err_fb_rel;
- memset(videomemory, 0, videomemorysize);
-
info->screen_base = (char *)videomemory;
info->fbops = &broadsheetfb_ops;
diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c
index 1b94643..fbef15f 100644
--- a/drivers/video/hecubafb.c
+++ b/drivers/video/hecubafb.c
@@ -231,11 +231,10 @@ static int __devinit hecubafb_probe(struct platform_device *dev)
videomemorysize = (DPY_W*DPY_H)/8;
- if (!(videomemory = vmalloc(videomemorysize)))
+ videomemory = vzalloc(videomemorysize);
+ if (!videomemory)
return retval;
- memset(videomemory, 0, videomemorysize);
-
info = framebuffer_alloc(sizeof(struct hecubafb_par), &dev->dev);
if (!info)
goto err_fballoc;
diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c
index ed64edf..97d45e5 100644
--- a/drivers/video/metronomefb.c
+++ b/drivers/video/metronomefb.c
@@ -628,12 +628,10 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
/* we need to add a spare page because our csum caching scheme walks
* to the end of the page */
videomemorysize = PAGE_SIZE + (fw * fh);
- videomemory = vmalloc(videomemorysize);
+ videomemory = vzalloc(videomemorysize);
if (!videomemory)
goto err_fb_rel;
- memset(videomemory, 0, videomemorysize);
-
info->screen_base = (char __force __iomem *)videomemory;
info->fbops = &metronomefb_ops;
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index a20218c..beac52f 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -395,10 +395,9 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
spin_lock_init(&info->dirty_lock);
spin_lock_init(&info->resize_lock);
- info->fb = vmalloc(fb_size);
+ info->fb = vzalloc(fb_size);
if (info->fb = NULL)
goto error_nomem;
- memset(info->fb, 0, fb_size);
info->nr_pages = (fb_size + PAGE_SIZE - 1) >> PAGE_SHIFT;
--
^ permalink raw reply related
* Re: [TRIVIAL PATCH next 12/15] video: Convert vmalloc/memset to vzalloc
From: Heiko Stübner @ 2011-05-28 17:48 UTC (permalink / raw)
To: Joe Perches
Cc: Jaya Kumar, Paul Mundt, Jeremy Fitzhardinge,
Konrad Rzeszutek Wilk, Jiri Kosina, linux-fbdev, linux-kernel,
xen-devel, virtualization
In-Reply-To: <77538de911b8af99f68b7bcfbaaedce8e40db04f.1306603968.git.joe@perches.com>
Am Samstag 28 Mai 2011, 19:36:32 schrieb Joe Perches:
> diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
> index 3ec4923..86573e2 100644
> --- a/drivers/video/arcfb.c
> +++ b/drivers/video/arcfb.c
> @@ -515,11 +515,10 @@ static int __devinit arcfb_probe(struct
> platform_device *dev)
>
> /* We need a flat backing store for the Arc's
> less-flat actual paged framebuffer */
> - if (!(videomemory = vmalloc(videomemorysize)))
> + videomemory = vmalloc(videomemorysize);
> + if (!videomemory)
> return retval;
shouldn't this be vzalloc too?
> - memset(videomemory, 0, videomemorysize);
> -
> info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev);
> if (!info)
> goto err;
Heiko
^ permalink raw reply
* [TRIVIAL PATCH next 12/15] video: Convert vmalloc/memset to vzalloc
From: Joe Perches @ 2011-05-28 17:36 UTC (permalink / raw)
To: Jaya Kumar, Paul Mundt, Jeremy Fitzhardinge,
Konrad Rzeszutek Wilk, Jiri Kosina
Cc: linux-fbdev, linux-kernel, xen-devel, virtualization
In-Reply-To: <cover.1306603968.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/video/arcfb.c | 5 ++---
drivers/video/broadsheetfb.c | 4 +---
drivers/video/hecubafb.c | 5 ++---
drivers/video/metronomefb.c | 4 +---
drivers/video/xen-fbfront.c | 3 +--
5 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index 3ec4923..86573e2 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -515,11 +515,10 @@ static int __devinit arcfb_probe(struct platform_device *dev)
/* We need a flat backing store for the Arc's
less-flat actual paged framebuffer */
- if (!(videomemory = vmalloc(videomemorysize)))
+ videomemory = vmalloc(videomemorysize);
+ if (!videomemory)
return retval;
- memset(videomemory, 0, videomemorysize);
-
info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev);
if (!info)
goto err;
diff --git a/drivers/video/broadsheetfb.c b/drivers/video/broadsheetfb.c
index ebda687..377dde3 100644
--- a/drivers/video/broadsheetfb.c
+++ b/drivers/video/broadsheetfb.c
@@ -1101,12 +1101,10 @@ static int __devinit broadsheetfb_probe(struct platform_device *dev)
videomemorysize = roundup((dpyw*dpyh), PAGE_SIZE);
- videomemory = vmalloc(videomemorysize);
+ videomemory = vzalloc(videomemorysize);
if (!videomemory)
goto err_fb_rel;
- memset(videomemory, 0, videomemorysize);
-
info->screen_base = (char *)videomemory;
info->fbops = &broadsheetfb_ops;
diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c
index 1b94643..fbef15f 100644
--- a/drivers/video/hecubafb.c
+++ b/drivers/video/hecubafb.c
@@ -231,11 +231,10 @@ static int __devinit hecubafb_probe(struct platform_device *dev)
videomemorysize = (DPY_W*DPY_H)/8;
- if (!(videomemory = vmalloc(videomemorysize)))
+ videomemory = vzalloc(videomemorysize);
+ if (!videomemory)
return retval;
- memset(videomemory, 0, videomemorysize);
-
info = framebuffer_alloc(sizeof(struct hecubafb_par), &dev->dev);
if (!info)
goto err_fballoc;
diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c
index ed64edf..97d45e5 100644
--- a/drivers/video/metronomefb.c
+++ b/drivers/video/metronomefb.c
@@ -628,12 +628,10 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
/* we need to add a spare page because our csum caching scheme walks
* to the end of the page */
videomemorysize = PAGE_SIZE + (fw * fh);
- videomemory = vmalloc(videomemorysize);
+ videomemory = vzalloc(videomemorysize);
if (!videomemory)
goto err_fb_rel;
- memset(videomemory, 0, videomemorysize);
-
info->screen_base = (char __force __iomem *)videomemory;
info->fbops = &metronomefb_ops;
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index a20218c..beac52f 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -395,10 +395,9 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
spin_lock_init(&info->dirty_lock);
spin_lock_init(&info->resize_lock);
- info->fb = vmalloc(fb_size);
+ info->fb = vzalloc(fb_size);
if (info->fb = NULL)
goto error_nomem;
- memset(info->fb, 0, fb_size);
info->nr_pages = (fb_size + PAGE_SIZE - 1) >> PAGE_SHIFT;
--
1.7.5.rc3.dirty
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox