* [GIT PULL] OMAP DSS for v3.6
From: Tomi Valkeinen @ 2012-07-22 18:13 UTC (permalink / raw)
To: Florian Tobias Schandinat
Cc: linux-omap, linux-fbdev, Tony Lindgren, Archit Taneja
[-- Attachment #1: Type: text/plain, Size: 6956 bytes --]
Hi Florian,
Here are OMAP DSS changes for 3.6. The main changes are:
- Patches from Archit, which reorganize the output side of omapdss. This
is much cleaner in itself, but will also help us in the future to
implement the missing omap4 features and omap5+ features.
- LCD3 patches from Chandrabhanu, which implement the support for LCD3
overlay manager (for omap5). His patches also generalize the code which
accesses the overlay manager related registers.
There hasn't been new patches applied to the DSS tree for 3 weeks, as
I'm on vacation. The tree has been in linux-next for that period, and I
haven't received any complaints so I hope the stuff works quite well.
Archit also reported that he has tested the linux-next, and it seems to
work fine.
There is a small conflict, though. This was caused by the two fixes
"OMAPDSS: fix warnings if CONFIG_PM_RUNTIME=n" and "OMAPDSS: Use PM
notifiers for system suspend", as I had already applied them into my
master branch before Archit sent them for you. And as you fixed the code
formatting issue (sorry about that), we have a small conflict there.
The conflict is trivial to resolve, and I also pushed for-florian-merged
branch to the same git tree below, which has the conflict resolved.
I'm still on vacation for the next week, but I'll check my email every
now and then to see if there are any issues.
Tomi
The following changes since commit cfaf025112d3856637ff34a767ef785ef5cf2ca9:
Linux 3.5-rc2 (2012-06-08 18:40:09 -0700)
are available in the git repository at:
git://gitorious.org/linux-omap-dss2/linux.git for-florian
for you to fetch changes up to 974a65825e0b5fbda49605f0416a2c975d66e9e6:
Merge "Apply LCD manager related parameters" from Archit (2012-06-29 14:13:07 +0300)
----------------------------------------------------------------
Archit Taneja (27):
OMAPDSS: Remove passive matrix LCD support (part 1)
OMAPDSS: Remove passive matrix LCD support (part 2)
OMAPDSS: Remove passive matrix LCD support (part 3)
OMAPDSS: Remove passive matrix LCD support (part 4)
OMAPDSS: Add some new fields to omap_video_timings
OMAPDSS: DISPLAY: Ignore newly added omap_video_timings fields for display timings sysfs file
OMAPDSS: DISPC: Configure newly added omap_video_timing fields
OMAPDSS: DISPC: Remove dispc_mgr_set_pol_freq()
OMAPFB: Map the newly added omap_video_timings fields with fb sync flags
OMAPDSS: Remove omap_panel_config enum from omap_dss_device
OMAPDSS: Add interlace parameter to omap_video_timings
OMAPDSS: DISPC/APPLY: Use interlace info in manager timings for dispc_ovl_setup()
OMAPFB: Map interlace field in omap_video_timings with fb vmode flags
OMAPDSS: HDMI: Remove custom hdmi_video_timings struct
OMAPDSS: DSI: Fix HSYNC, VSYNC and DE polarities between DISPC and DSI
OMAPDSS: DISPC: Change return type of dispc_mgr_set_clock_div()
OMAPDSS: Add struct to hold LCD overlay manager configuration
OMAPDSS: DPI: Configure dss_lcd_mgr_config struct with lcd manager parameters
OMAPDSS: RFBI: Configure dss_lcd_mgr_config struct with lcd manager parameters
OMAPDSS: DSI: Configure dss_lcd_mgr_config struct with lcd manager parameters
OMAPDSS: SDI: Configure dss_lcd_mgr_config struct with lcd manager parameters
OMAPDSS: APPLY: Remove DISPC writes to manager's lcd parameters in interface drivers
OMAPDSS: MANAGER: Check LCD related overlay manager parameters
OMAPDSS: APPLY: Remove usage of omap_dss_device from manual/auto update checks
OMAPDSS: DISPC: Remove a redundant function
OMAPDSS: RFBI: Use dss_mgr_enable to enable the overlay manager
OMAPDSS: OVERLAY: Clean up replication checking
Chandrabhanu Mahapatra (5):
OMAPDSS: Cleanup implementation of LCD channels
OMAPDSS: Add support for LCD3 channel
OMAPDSS: Add LCD3 overlay manager and Clock and IRQ support
OMAPDSS: Add dump and debug support for LCD3
ARM: OMAP2PLUS: DSS: Disable LCD3 output when resetting DSS
Jassi Brar (2):
OMAPDSS: HDMI: Discard phy_tx_enabled member
OMAPDSS: HDMI: Replace spinlock with mutex in hdmi_check_hpd_state
Peter Meerwald (1):
OMAPDSS: fix specification spelling in Kconfig
Rajendra Nayak (1):
OMAPDSS: add clk_prepare_enable and clk_disable_unprepare
Tomi Valkeinen (6):
Merge tag 'v3.5-rc2'
OMAPDSS: remove enum omap_dss_overlay_managers
OMAPDSS: Use PM notifiers for system suspend
OMAPDSS: fix warnings if CONFIG_PM_RUNTIME=n
Merge Misc DSS clean ups from Archit
Merge "Apply LCD manager related parameters" from Archit
arch/arm/mach-omap2/display.c | 29 +-
drivers/video/omap2/displays/panel-acx565akm.c | 10 +-
drivers/video/omap2/displays/panel-generic-dpi.c | 179 ++++---
.../omap2/displays/panel-lgphilips-lb035q02.c | 8 +-
drivers/video/omap2/displays/panel-n8x0.c | 1 -
.../omap2/displays/panel-nec-nl8048hl11-01b.c | 9 +-
drivers/video/omap2/displays/panel-picodlp.c | 9 +-
.../video/omap2/displays/panel-sharp-ls037v7dw01.c | 9 +-
drivers/video/omap2/displays/panel-taal.c | 3 +-
drivers/video/omap2/displays/panel-tfp410.c | 7 +-
.../video/omap2/displays/panel-tpo-td043mtea1.c | 8 +-
drivers/video/omap2/dss/Kconfig | 4 +-
drivers/video/omap2/dss/apply.c | 91 +++-
drivers/video/omap2/dss/core.c | 48 +-
drivers/video/omap2/dss/dispc.c | 496 ++++++++++----------
drivers/video/omap2/dss/dispc.h | 28 ++
drivers/video/omap2/dss/display.c | 40 +-
drivers/video/omap2/dss/dpi.c | 64 +--
drivers/video/omap2/dss/dsi.c | 156 +++---
drivers/video/omap2/dss/dss.c | 21 +-
drivers/video/omap2/dss/dss.h | 54 ++-
drivers/video/omap2/dss/dss_features.h | 5 +-
drivers/video/omap2/dss/hdmi.c | 248 ++++++++--
drivers/video/omap2/dss/hdmi_panel.c | 9 +-
drivers/video/omap2/dss/manager.c | 51 +-
drivers/video/omap2/dss/overlay.c | 33 +-
drivers/video/omap2/dss/rfbi.c | 42 +-
drivers/video/omap2/dss/sdi.c | 42 +-
drivers/video/omap2/dss/ti_hdmi.h | 21 +-
drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c | 26 +-
drivers/video/omap2/dss/venc.c | 10 +-
drivers/video/omap2/omapfb/omapfb-main.c | 51 +-
include/video/omapdss.h | 51 +-
33 files changed, 1172 insertions(+), 691 deletions(-)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* [PATCH] video: exynos mipi dsi: Fix mipi dsi regulators handling issue
From: Donghwa Lee @ 2012-07-23 2:25 UTC (permalink / raw)
To: linux-arm-kernel
When FB_BLANK_UNLANK event occured, exynos mipi dsi regulators have to turn on.
Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/video/exynos/exynos_mipi_dsi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c
index 6c1f5c3..9390640 100644
--- a/drivers/video/exynos/exynos_mipi_dsi.c
+++ b/drivers/video/exynos/exynos_mipi_dsi.c
@@ -154,7 +154,7 @@ static int exynos_mipi_dsi_blank_mode(struct mipi_dsim_device *dsim, int power)
if (client_drv && client_drv->power_on)
client_drv->power_on(client_dev, 1);
- exynos_mipi_regulator_disable(dsim);
+ exynos_mipi_regulator_enable(dsim);
/* enable MIPI-DSI PHY. */
if (dsim->pd->phy_enable)
--
1.7.4.1
^ permalink raw reply related
* [PATCH] video: exynos: s6e8ax0: support early fb event of fb_blank()
From: Donghwa Lee @ 2012-07-23 4:27 UTC (permalink / raw)
To: linux-arm-kernel
This patch supports early fb event of fb_blank().
- In case of lcd power off : call early_set_power() interface and lcd
power is off. And then framebuffer is blanked.
- In case of lcd power on : First, framebuffer is unblanked, and then
call set_power() interface to turn lcd on.
Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/video/exynos/s6e8ax0.c | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/drivers/video/exynos/s6e8ax0.c b/drivers/video/exynos/s6e8ax0.c
index 05d080b..e51d024 100644
--- a/drivers/video/exynos/s6e8ax0.c
+++ b/drivers/video/exynos/s6e8ax0.c
@@ -663,6 +663,37 @@ static int s6e8ax0_gamma_ctrl(struct s6e8ax0 *lcd, int gamma)
return 0;
}
+static int s6e8aa0_early_set_power(struct lcd_device *ld, int power)
+{
+ struct s6e8ax0 *lcd = lcd_get_data(ld);
+ struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd);
+ int ret = 0;
+
+ if (power != FB_BLANK_UNBLANK && power != FB_BLANK_POWERDOWN &&
+ power != FB_BLANK_NORMAL) {
+ dev_err(lcd->dev, "power value should be 0, 1 or 4.\n");
+ return -EINVAL;
+ }
+
+ if (lcd->power = power) {
+ dev_err(lcd->dev, "power mode is same as previous one.\n");
+ return -EINVAL;
+ }
+
+ if (ops->set_early_blank_mode) {
+ /* LCD power off */
+ if ((POWER_IS_OFF(power) && POWER_IS_ON(lcd->power))
+ || (POWER_IS_ON(lcd->power) && POWER_IS_NRM(power))) {
+ ret = ops->set_early_blank_mode(lcd_to_master(lcd),
+ power);
+ if (!ret && lcd->power != power)
+ lcd->power = power;
+ }
+ }
+
+ return ret;
+}
+
static int s6e8ax0_set_power(struct lcd_device *ld, int power)
{
struct s6e8ax0 *lcd = lcd_get_data(ld);
@@ -731,6 +762,7 @@ static int s6e8ax0_set_brightness(struct backlight_device *bd)
}
static struct lcd_ops s6e8ax0_lcd_ops = {
+ .early_set_power = s6e8aa0_early_set_power,
.set_power = s6e8ax0_set_power,
.get_power = s6e8ax0_get_power,
};
--
1.7.4.1
^ permalink raw reply related
* RE: [PATCH] video: da8xx-fb: allow frame to complete before disabling LCDC
From: Manjunathappa, Prakash @ 2012-07-23 7:52 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1342799516-10842-1-git-send-email-prakash.pm@ti.com>
Hi Florian Tobias Schandinat,
On Sun, Jul 22, 2012 at 17:20:28, Florian Tobias Schandinat wrote:
> Hi,
>
> On 07/20/2012 03:51 PM, Manjunathappa, Prakash wrote:
> > Wait for active frame transfer to complete before disabling LCDC.
> > At the same this wait is not be required when there are sync and
> > underflow errors.
> >
> > Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
> > ---
> > drivers/video/da8xx-fb.c | 58 ++++++++++++++++++++++++++++++++++++---------
> > 1 files changed, 46 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
> > index 4440292..c178592 100644
> > --- a/drivers/video/da8xx-fb.c
> > +++ b/drivers/video/da8xx-fb.c
> > @@ -31,6 +31,7 @@
> > #include <linux/cpufreq.h>
> > #include <linux/console.h>
> > #include <linux/slab.h>
> > +#include <linux/delay.h>
> > #include <video/da8xx-fb.h>
> > #include <asm/div64.h>
> >
> > @@ -45,6 +46,7 @@
> > #define LCD_PL_LOAD_DONE BIT(6)
> > #define LCD_FIFO_UNDERFLOW BIT(5)
> > #define LCD_SYNC_LOST BIT(2)
> > +#define LCD_FRAME_DONE BIT(0)
> >
> > /* LCD DMA Control Register */
> > #define LCD_DMA_BURST_SIZE(x) ((x) << 4)
> > @@ -129,6 +131,8 @@
> > #define RIGHT_MARGIN 64
> > #define UPPER_MARGIN 32
> > #define LOWER_MARGIN 32
> > +#define WAIT_FOR_FRAME_DONE true
> > +#define NO_WAIT_FOR_FRAME_DONE false
>
> These defines look a bit strange. While I consider it acceptable, one
> really should know the arguments of a function and hence it doesn't make
> sense to add an extra abstraction to bool (in contrast to flags where
> such defines are really helpful).
>
I agree to remove them.
> >
> > static resource_size_t da8xx_fb_reg_base;
> > static struct resource *lcdc_regs;
> > @@ -280,13 +284,39 @@ static inline void lcd_enable_raster(void)
> > }
> >
> > /* Disable the Raster Engine of the LCD Controller */
> > -static inline void lcd_disable_raster(void)
> > +static inline void lcd_disable_raster(bool wait_for_frame_done)
> > {
> > u32 reg;
> > + u32 loop_cnt = 0;
> > + u32 stat;
> > + u32 i = 0;
> > +
> > + /* 50 milli seconds should be sufficient for a frame to complete */
> > + if (wait_for_frame_done)
> > + loop_cnt = 50;
> >
> > reg = lcdc_read(LCD_RASTER_CTRL_REG);
> > if (reg & LCD_RASTER_ENABLE)
> > lcdc_write(reg & ~LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG);
> > +
> > + /* Wait for the current frame to complete */
> > + do {
> > + if (lcd_revision = LCD_VERSION_1)
> > + stat = lcdc_read(LCD_STAT_REG);
> > + else
> > + stat = lcdc_read(LCD_RAW_STAT_REG);
> > + mdelay(1);
> > + } while (!(stat & LCD_FRAME_DONE) && (i++ < loop_cnt));
>
> I don't know the documentation of your hardware but this really looks
> like you are waiting after you disabled it.
>
Correct, it is expected to wait for frame_done before applying the software reset.
I will re-write the commit message to convey the same.
> > +
> > + if (lcd_revision = LCD_VERSION_1)
> > + lcdc_write(stat, LCD_STAT_REG);
> > + else
> > + lcdc_write(stat, LCD_MASKED_STAT_REG);
> > +
> > + if ((loop_cnt != 0) && (i >= loop_cnt)) {
> > + pr_err("LCD Controller timed out\n");
> > + return;
> > + }
> > }
> >
> > static void lcd_blit(int load_mode, struct da8xx_fb_par *par)
> > @@ -663,7 +693,7 @@ static int fb_setcolreg(unsigned regno, unsigned red, unsigned green,
> > static void lcd_reset(struct da8xx_fb_par *par)
> > {
> > /* Disable the Raster if previously Enabled */
> > - lcd_disable_raster();
> > + lcd_disable_raster(NO_WAIT_FOR_FRAME_DONE);
> >
> > /* DMA has to be disabled */
> > lcdc_write(0, LCD_DMA_CTRL_REG);
> > @@ -760,7 +790,8 @@ static irqreturn_t lcdc_irq_handler_rev02(int irq, void *arg)
> > u32 reg_int;
> >
> > if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) {
> > - lcd_disable_raster();
> > + pr_err("LCDC sync lost or underflow error occured\n");
> > + lcd_disable_raster(NO_WAIT_FOR_FRAME_DONE);
> > lcdc_write(stat, LCD_MASKED_STAT_REG);
> > lcd_enable_raster();
> > } else if (stat & LCD_PL_LOAD_DONE) {
> > @@ -770,7 +801,7 @@ static irqreturn_t lcdc_irq_handler_rev02(int irq, void *arg)
> > * interrupt via the following write to the status register. If
> > * this is done after then one gets multiple PL done interrupts.
> > */
> > - lcd_disable_raster();
> > + lcd_disable_raster(NO_WAIT_FOR_FRAME_DONE);
> >
> > lcdc_write(stat, LCD_MASKED_STAT_REG);
> >
> > @@ -815,7 +846,8 @@ static irqreturn_t lcdc_irq_handler_rev01(int irq, void *arg)
> > u32 reg_ras;
> >
> > if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) {
> > - lcd_disable_raster();
> > + pr_err("LCDC sync lost or underflow error occured\n");
> > + lcd_disable_raster(NO_WAIT_FOR_FRAME_DONE);
> > lcdc_write(stat, LCD_STAT_REG);
> > lcd_enable_raster();
> > } else if (stat & LCD_PL_LOAD_DONE) {
> > @@ -825,7 +857,7 @@ static irqreturn_t lcdc_irq_handler_rev01(int irq, void *arg)
> > * interrupt via the following write to the status register. If
> > * this is done after then one gets multiple PL done interrupts.
> > */
> > - lcd_disable_raster();
> > + lcd_disable_raster(NO_WAIT_FOR_FRAME_DONE);
> >
> > lcdc_write(stat, LCD_STAT_REG);
> >
> > @@ -945,7 +977,7 @@ static int lcd_da8xx_cpufreq_transition(struct notifier_block *nb,
> > if (val = CPUFREQ_POSTCHANGE) {
> > if (par->lcd_fck_rate != clk_get_rate(par->lcdc_clk)) {
> > par->lcd_fck_rate = clk_get_rate(par->lcdc_clk);
> > - lcd_disable_raster();
> > + lcd_disable_raster(WAIT_FOR_FRAME_DONE);
> > lcd_calc_clk_divider(par);
> > lcd_enable_raster();
> > }
> > @@ -982,7 +1014,7 @@ static int __devexit fb_remove(struct platform_device *dev)
> > if (par->panel_power_ctrl)
> > par->panel_power_ctrl(0);
> >
> > - lcd_disable_raster();
> > + lcd_disable_raster(WAIT_FOR_FRAME_DONE);
> > lcdc_write(0, LCD_RASTER_CTRL_REG);
> >
> > /* disable DMA */
> > @@ -1095,7 +1127,7 @@ static int cfb_blank(int blank, struct fb_info *info)
> > if (par->panel_power_ctrl)
> > par->panel_power_ctrl(0);
> >
> > - lcd_disable_raster();
> > + lcd_disable_raster(WAIT_FOR_FRAME_DONE);
> > break;
> > default:
> > ret = -EINVAL;
> > @@ -1435,7 +1467,7 @@ static int fb_suspend(struct platform_device *dev, pm_message_t state)
> > par->panel_power_ctrl(0);
> >
> > fb_set_suspend(info, 1);
> > - lcd_disable_raster();
> > + lcd_disable_raster(WAIT_FOR_FRAME_DONE);
> > clk_disable(par->lcdc_clk);
> > console_unlock();
> >
> > @@ -1447,11 +1479,13 @@ static int fb_resume(struct platform_device *dev)
> > struct da8xx_fb_par *par = info->par;
> >
> > console_lock();
> > - if (par->panel_power_ctrl)
> > - par->panel_power_ctrl(1);
> >
> > clk_enable(par->lcdc_clk);
> > + usleep_range(1000, 2000);
> > lcd_enable_raster();
> > + if (par->panel_power_ctrl)
> > + par->panel_power_ctrl(1);
> > +
>
> This change looks unrelated and should go in a separate patch?
>
Agree, I will send out in separate patch.
Thanks,
Prakash
> > fb_set_suspend(info, 0);
> > console_unlock();
> >
>
>
> Best regards,
>
> Florian Tobias Schandinat
>
^ permalink raw reply
* RE: [PATCH v3] video: da8xx-fb: add 24bpp LCD configuration support
From: Manjunathappa, Prakash @ 2012-07-23 8:26 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1342712266-4381-1-git-send-email-prakash.pm@ti.com>
Hi,
On Thu, Jul 19, 2012 at 21:07:46, Manjunathappa, Prakash wrote:
> LCD controller on am335x supports 24bpp raster configuration in addition
> to ones on da850. LCDC also supports 24bpp in unpacked format having
> ARGB:8888 32bpp format data in DDR, but it doesn't interpret alpha
> component of the data.
>
> Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
> Cc: Anatolij Gustschin <agust@denx.de>
> ---
> Since v2:
> Fixed additional configurations for 24bpp support.
> Since v1:
> Simplified calculation of pseudopalette for FB_VISUAL_TRUECOLOR type.
>
> drivers/video/da8xx-fb.c | 127 ++++++++++++++++++++++++++++++++++------------
> 1 files changed, 94 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
> index 47118c7..3d2d0d1 100644
> --- a/drivers/video/da8xx-fb.c
> +++ b/drivers/video/da8xx-fb.c
> @@ -83,6 +83,8 @@
> #define LCD_V2_LIDD_CLK_EN BIT(1)
> #define LCD_V2_CORE_CLK_EN BIT(0)
> #define LCD_V2_LPP_B10 26
> +#define LCD_V2_TFT_24BPP_MODE BIT(25)
> +#define LCD_V2_TFT_24BPP_UNPACK BIT(26)
>
> /* LCD Raster Timing 2 Register */
> #define LCD_AC_BIAS_TRANSITIONS_PER_INT(x) ((x) << 16)
> @@ -153,7 +155,7 @@ struct da8xx_fb_par {
> unsigned int dma_end;
> struct clk *lcdc_clk;
> int irq;
> - unsigned short pseudo_palette[16];
> + unsigned long pseudo_palette[16];
I am still not convinced as sizes of "unsigned long" and "unsigned int" are not
guaranteed to be 32bit across platforms and compilers, so planning to retain u32.
Florian Tobias Schandinat,
Can you please comment?
Here is the history:
http://marc.info/?l=linux-fbdev&m\x134259216714719&w=2
> unsigned int palette_sz;
> unsigned int pxl_clk;
> int blank;
> @@ -482,6 +484,9 @@ static int lcd_cfg_frame_buffer(struct da8xx_fb_par *par, u32 width, u32 height,
> {
> u32 reg;
>
> + if ((bpp > 16) && (lcd_revision = LCD_VERSION_1))
> + return -EINVAL;
> +
> /* Set the Panel Width */
> /* Pixels per line = (PPL + 1)*16 */
> if (lcd_revision = LCD_VERSION_1) {
> @@ -525,6 +530,12 @@ static int lcd_cfg_frame_buffer(struct da8xx_fb_par *par, u32 width, u32 height,
> reg = lcdc_read(LCD_RASTER_CTRL_REG) & ~(1 << 8);
> if (raster_order)
> reg |= LCD_RASTER_ORDER;
> +
> + if (bpp = 24)
> + reg |= LCD_V2_TFT_24BPP_MODE;
> + else if (bpp = 32)
> + reg |= (LCD_V2_TFT_24BPP_MODE | LCD_V2_TFT_24BPP_UNPACK);
> +
> lcdc_write(reg, LCD_RASTER_CTRL_REG);
>
> switch (bpp) {
> @@ -532,6 +543,8 @@ static int lcd_cfg_frame_buffer(struct da8xx_fb_par *par, u32 width, u32 height,
> case 2:
> case 4:
> case 16:
> + case 24:
> + case 32:
> par->palette_sz = 16 * 2;
> break;
>
> @@ -546,6 +559,8 @@ static int lcd_cfg_frame_buffer(struct da8xx_fb_par *par, u32 width, u32 height,
> return 0;
> }
>
> +
> +#define CNVT_TOHW(val, width) ((((val)<<(width))+0x7FFF-(val))>>16)
since multiple FB drivers have re-defined this macro, I will move this to common place(linux/fb.h) and
convert it as inline function.
Thanks,
Prakash
> static int fb_setcolreg(unsigned regno, unsigned red, unsigned green,
[...]
^ permalink raw reply
* Re: [RFC][PATCH V2 3/3] tegra: add pwm backlight device tree nodes
From: Stephen Warren @ 2012-07-23 20:38 UTC (permalink / raw)
To: Alex Courbot
Cc: Simon Glass, Thierry Reding, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org,
devicetree-discuss@lists.ozlabs.org
In-Reply-To: <4FFFB2DC.3040605@nvidia.com>
On 07/12/2012 11:32 PM, Alex Courbot wrote:
> On 07/12/2012 11:27 PM, Simon Glass wrote
...
>> From my understanding mixing strings and numbers in a property is
>> frowned on though.
>
> But doesn't it make sense in the current case? The power sequence is
> basically a program that is run by an interpreter. From this
> perspective, it makes more sense to me to have it as a binary field
> rather than a hierarchy of nodes and properties that will be harder to
> parse and will make error detection more complicated. I don't really see
> any practical benefit from turning the steps into sub-nodes, but then
> again I am not so familiar with the DT.
Mixing strings and integers in a property isn't "allowed" (by convention
of DT bindings reviewers - as you noticed, dtc will happily compile it);
there are practical issues with attempting to do so, such as causing the
integer values to be unaligned, and thus causing the current integer
parsing code to fail, etc.
^ permalink raw reply
* [PATCH 1/4] fbcon: use kstrtouint instead of deprecated function simple_strtoul.
From: Paul Cercueil @ 2012-07-24 1:00 UTC (permalink / raw)
To: FlorianSchandinat; +Cc: linux-kernel, linux-fbdev, Paul Cercueil
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
drivers/video/console/fbcon.c | 102 ++++++++++++++++++++++++++++-------------
1 file changed, 69 insertions(+), 33 deletions(-)
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 2e471c2..a0b1818 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -435,7 +435,7 @@ static void fbcon_del_cursor_timer(struct fb_info *info)
static int __init fb_console_setup(char *this_opt)
{
char *options;
- int i, j;
+ int i, j, ret;
if (!this_opt || !*this_opt)
return 1;
@@ -445,18 +445,29 @@ static int __init fb_console_setup(char *this_opt)
strcpy(fontname, options + 5);
if (!strncmp(options, "scrollback:", 11)) {
+ char *k;
options += 11;
- if (*options) {
- fbcon_softback_size = simple_strtoul(options, &options, 0);
- if (*options = 'k' || *options = 'K') {
- fbcon_softback_size *= 1024;
- options++;
- }
- if (*options != ',')
- return 1;
- options++;
- } else
- return 1;
+ k = options;
+
+ while (*k != '\0' && *k != 'k' && *k != 'K')
+ k++;
+
+ /* Clear the 'k' or 'K' suffix to
+ * prevent errors with kstrtouint */
+ if (*k != '\0')
+ *k++ = '\0';
+ else
+ k = NULL;
+
+ ret = kstrtouint(options, 0, (unsigned int *)
+ &fbcon_softback_size);
+
+ if (!ret && k)
+ fbcon_softback_size *= 1024;
+
+ /* (k && *k): Check for garbage after the suffix */
+ if (ret || (k && *k))
+ pr_warn("fbcon: scrollback: incorrect value.\n");
}
if (!strncmp(options, "map:", 4)) {
@@ -476,22 +487,44 @@ static int __init fb_console_setup(char *this_opt)
}
if (!strncmp(options, "vc:", 3)) {
+ char *dash;
options += 3;
- if (*options)
- first_fb_vc = simple_strtoul(options, &options, 10) - 1;
- if (first_fb_vc < 0)
- first_fb_vc = 0;
- if (*options++ = '-')
- last_fb_vc = simple_strtoul(options, &options, 10) - 1;
- fbcon_is_default = 0;
- }
+
+ dash = strchr(options, '-');
+ if (dash)
+ *dash++ = '\0';
+
+ ret = kstrtouint(options, 10,
+ (unsigned int *) &first_fb_vc);
+ if (!ret) {
+ if (--first_fb_vc < 0)
+ first_fb_vc = 0;
+
+ if (dash) {
+ ret = kstrtouint(dash, 10,
+ (unsigned int *)
+ &last_fb_vc);
+ if (!ret)
+ last_fb_vc--;
+ }
+ }
+
+ if (!ret)
+ fbcon_is_default = 0;
+ else
+ pr_warn("fbcon: vc: incorrect value.\n");
+ }
if (!strncmp(options, "rotate:", 7)) {
options += 7;
- if (*options)
- initial_rotation = simple_strtoul(options, &options, 0);
- if (initial_rotation > 3)
- initial_rotation = 0;
+ ret = kstrtouint(options, 0, (unsigned int *)
+ &initial_rotation);
+ if (!ret) {
+ if (initial_rotation > 3)
+ initial_rotation = 0;
+ } else {
+ pr_warn("fbcon: rotate: incorrect value.\n");
+ }
}
}
return 1;
@@ -3312,8 +3345,8 @@ static ssize_t store_rotate(struct device *device,
size_t count)
{
struct fb_info *info;
- int rotate, idx;
- char **last = NULL;
+ int idx;
+ unsigned int rotate;
if (fbcon_has_exited)
return count;
@@ -3325,7 +3358,8 @@ static ssize_t store_rotate(struct device *device,
goto err;
info = registered_fb[idx];
- rotate = simple_strtoul(buf, last, 0);
+ if (kstrtouint(buf, 0, &rotate))
+ goto err;
fbcon_rotate(info, rotate);
err:
console_unlock();
@@ -3337,8 +3371,8 @@ static ssize_t store_rotate_all(struct device *device,
size_t count)
{
struct fb_info *info;
- int rotate, idx;
- char **last = NULL;
+ int idx;
+ unsigned int rotate;
if (fbcon_has_exited)
return count;
@@ -3350,7 +3384,8 @@ static ssize_t store_rotate_all(struct device *device,
goto err;
info = registered_fb[idx];
- rotate = simple_strtoul(buf, last, 0);
+ if (kstrtouint(buf, 0, &rotate))
+ goto err;
fbcon_rotate_all(info, rotate);
err:
console_unlock();
@@ -3412,8 +3447,8 @@ static ssize_t store_cursor_blink(struct device *device,
const char *buf, size_t count)
{
struct fb_info *info;
- int blink, idx;
- char **last = NULL;
+ int idx;
+ unsigned int blink;
if (fbcon_has_exited)
return count;
@@ -3429,7 +3464,8 @@ static ssize_t store_cursor_blink(struct device *device,
if (!info->fbcon_par)
goto err;
- blink = simple_strtoul(buf, last, 0);
+ if (kstrtouint(buf, 0, &blink))
+ goto err;
if (blink) {
fbcon_cursor_noblink = 0;
--
1.7.10.4
^ permalink raw reply related
* [PATCH 2/4] fbcon: prevent possible buffer overflow.
From: Paul Cercueil @ 2012-07-24 1:00 UTC (permalink / raw)
To: FlorianSchandinat; +Cc: linux-kernel, linux-fbdev, Paul Cercueil
In-Reply-To: <1343091626-11435-1-git-send-email-paul@crapouillou.net>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
drivers/video/console/fbcon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index a0b1818..3ffab97 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -442,7 +442,7 @@ static int __init fb_console_setup(char *this_opt)
while ((options = strsep(&this_opt, ",")) != NULL) {
if (!strncmp(options, "font:", 5))
- strcpy(fontname, options + 5);
+ strlcpy(fontname, options + 5, sizeof(fontname));
if (!strncmp(options, "scrollback:", 11)) {
char *k;
--
1.7.10.4
^ permalink raw reply related
* [PATCH 3/4] fbcon: continue parsing parameters after an error.
From: Paul Cercueil @ 2012-07-24 1:00 UTC (permalink / raw)
To: FlorianSchandinat; +Cc: linux-kernel, linux-fbdev, Paul Cercueil
In-Reply-To: <1343091626-11435-1-git-send-email-paul@crapouillou.net>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
drivers/video/console/fbcon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 3ffab97..9b83b75 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -481,9 +481,9 @@ static int __init fb_console_setup(char *this_opt)
}
fbcon_map_override();
+ } else {
+ pr_warn("fbcon: map: incorrect value.\n");
}
-
- return 1;
}
if (!strncmp(options, "vc:", 3)) {
--
1.7.10.4
^ permalink raw reply related
* [PATCH 4/4] fbcon: optimize parameters parsing loop.
From: Paul Cercueil @ 2012-07-24 1:00 UTC (permalink / raw)
To: FlorianSchandinat; +Cc: linux-kernel, linux-fbdev, Paul Cercueil
In-Reply-To: <1343091626-11435-1-git-send-email-paul@crapouillou.net>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
drivers/video/console/fbcon.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 9b83b75..1ecaf68 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -441,8 +441,10 @@ static int __init fb_console_setup(char *this_opt)
return 1;
while ((options = strsep(&this_opt, ",")) != NULL) {
- if (!strncmp(options, "font:", 5))
+ if (!strncmp(options, "font:", 5)) {
strlcpy(fontname, options + 5, sizeof(fontname));
+ continue;
+ }
if (!strncmp(options, "scrollback:", 11)) {
char *k;
@@ -468,6 +470,7 @@ static int __init fb_console_setup(char *this_opt)
/* (k && *k): Check for garbage after the suffix */
if (ret || (k && *k))
printk(KERN_WARNING "fbcon: scrollback: incorrect value.\n");
+ continue;
}
if (!strncmp(options, "map:", 4)) {
@@ -484,6 +487,7 @@ static int __init fb_console_setup(char *this_opt)
} else {
printk(KERN_WARNING "fbcon: map: incorrect value.\n");
}
+ continue;
}
if (!strncmp(options, "vc:", 3)) {
@@ -513,6 +517,7 @@ static int __init fb_console_setup(char *this_opt)
fbcon_is_default = 0;
else
printk(KERN_WARNING "fbcon: vc: incorrect value.\n");
+ continue;
}
if (!strncmp(options, "rotate:", 7)) {
@@ -525,6 +530,7 @@ static int __init fb_console_setup(char *this_opt)
} else {
printk(KERN_WARNING "fbcon: rotate: incorrect value.\n");
}
+ continue;
}
}
return 1;
--
1.7.10.4
^ permalink raw reply related
* [PATCH v2] video: exynos: s6e8ax0: support early fb event of fb_blank()
From: Donghwa Lee @ 2012-07-24 2:19 UTC (permalink / raw)
To: linux-arm-kernel
This patch supports early fb event of fb_blank().
- In case of lcd power off : call early_set_power() interface and lcd
power is off. And then framebuffer is blanked.
- In case of lcd power on : First, framebuffer is unblanked, and then
call set_power() interface to turn lcd on.
Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Changes of v1:
- changes function name from s6e8aa0_early_set_power() to
s6e8ax0_early_set_power()
drivers/video/exynos/s6e8ax0.c | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/drivers/video/exynos/s6e8ax0.c b/drivers/video/exynos/s6e8ax0.c
index 05d080b..bfb1919 100644
--- a/drivers/video/exynos/s6e8ax0.c
+++ b/drivers/video/exynos/s6e8ax0.c
@@ -663,6 +663,37 @@ static int s6e8ax0_gamma_ctrl(struct s6e8ax0 *lcd, int gamma)
return 0;
}
+static int s6e8ax0_early_set_power(struct lcd_device *ld, int power)
+{
+ struct s6e8ax0 *lcd = lcd_get_data(ld);
+ struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd);
+ int ret = 0;
+
+ if (power != FB_BLANK_UNBLANK && power != FB_BLANK_POWERDOWN &&
+ power != FB_BLANK_NORMAL) {
+ dev_err(lcd->dev, "power value should be 0, 1 or 4.\n");
+ return -EINVAL;
+ }
+
+ if (lcd->power = power) {
+ dev_err(lcd->dev, "power mode is same as previous one.\n");
+ return -EINVAL;
+ }
+
+ if (ops->set_early_blank_mode) {
+ /* LCD power off */
+ if ((POWER_IS_OFF(power) && POWER_IS_ON(lcd->power))
+ || (POWER_IS_ON(lcd->power) && POWER_IS_NRM(power))) {
+ ret = ops->set_early_blank_mode(lcd_to_master(lcd),
+ power);
+ if (!ret && lcd->power != power)
+ lcd->power = power;
+ }
+ }
+
+ return ret;
+}
+
static int s6e8ax0_set_power(struct lcd_device *ld, int power)
{
struct s6e8ax0 *lcd = lcd_get_data(ld);
@@ -731,6 +762,7 @@ static int s6e8ax0_set_brightness(struct backlight_device *bd)
}
static struct lcd_ops s6e8ax0_lcd_ops = {
+ .early_set_power = s6e8ax0_early_set_power,
.set_power = s6e8ax0_set_power,
.get_power = s6e8ax0_get_power,
};
--
1.7.4.1
^ permalink raw reply related
* [PATCH v2] da8xx-fb: enable sync lost interrupt
From: Manjunathappa, Prakash @ 2012-07-24 3:55 UTC (permalink / raw)
To: linux-fbdev
Patch enables sync lost interrupt and interrupt handler already
takes care to handle it.
Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
---
Since v1:
Minor nit, replaced spaces with tabs.
drivers/video/da8xx-fb.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 47118c7..8163832 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -54,6 +54,7 @@
#define LCD_DMA_BURST_8 0x3
#define LCD_DMA_BURST_16 0x4
#define LCD_V1_END_OF_FRAME_INT_ENA BIT(2)
+#define LCD_V1_SYNC_LOST_ENA BIT(5)
#define LCD_V2_END_OF_FRAME0_INT_ENA BIT(8)
#define LCD_V2_END_OF_FRAME1_INT_ENA BIT(9)
#define LCD_DUAL_FRAME_BUFFER_ENABLE BIT(0)
@@ -441,10 +442,10 @@ static int lcd_cfg_display(const struct lcd_ctrl_config *cfg)
/* enable additional interrupts here */
if (lcd_revision = LCD_VERSION_1) {
- reg |= LCD_V1_UNDERFLOW_INT_ENA;
+ reg |= LCD_V1_UNDERFLOW_INT_ENA | LCD_V1_SYNC_LOST_ENA;
} else {
reg_int = lcdc_read(LCD_INT_ENABLE_SET_REG) |
- LCD_V2_UNDERFLOW_INT_ENA;
+ LCD_V2_UNDERFLOW_INT_ENA | LCD_SYNC_LOST;
lcdc_write(reg_int, LCD_INT_ENABLE_SET_REG);
}
@@ -718,6 +719,7 @@ static irqreturn_t lcdc_irq_handler_rev02(int irq, void *arg)
u32 reg_int;
if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) {
+ pr_err("LCDC sync lost or underflow error occurred\n");
lcd_disable_raster();
lcdc_write(stat, LCD_MASKED_STAT_REG);
lcd_enable_raster();
@@ -773,6 +775,7 @@ static irqreturn_t lcdc_irq_handler_rev01(int irq, void *arg)
u32 reg_ras;
if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) {
+ pr_err("LCDC sync lost or underflow error occurred\n");
lcd_disable_raster();
lcdc_write(stat, LCD_STAT_REG);
lcd_enable_raster();
--
1.7.1
^ permalink raw reply related
* [PATCH v2] da8xx-fb: allow frame to complete after disabling LCDC
From: Manjunathappa, Prakash @ 2012-07-24 4:21 UTC (permalink / raw)
To: linux-fbdev
Wait for active frame transfer to complete after disabling LCDC.
At the same this wait is not be required when there are sync and
underflow errors.
More information on disable and reset sequence can be found in
section 13.4.6 of AM335x TRM @www.ti.com/am335x.
Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
---
Patch applies on top of below patch under review:
http://marc.info/?l=linux-fbdev&m\x134280060828708&w=2
"video: da8xx-fb: do clock reset of revision 2 LCDC before enabling"
Since v1:
Changed the commit message, also added link to hardware specification.
drivers/video/da8xx-fb.c | 48 ++++++++++++++++++++++++++++++++++++---------
1 files changed, 38 insertions(+), 10 deletions(-)
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index a908dfd..0fb4d7d 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -31,6 +31,7 @@
#include <linux/cpufreq.h>
#include <linux/console.h>
#include <linux/slab.h>
+#include <linux/delay.h>
#include <video/da8xx-fb.h>
#include <asm/div64.h>
@@ -45,6 +46,7 @@
#define LCD_PL_LOAD_DONE BIT(6)
#define LCD_FIFO_UNDERFLOW BIT(5)
#define LCD_SYNC_LOST BIT(2)
+#define LCD_FRAME_DONE BIT(0)
/* LCD DMA Control Register */
#define LCD_DMA_BURST_SIZE(x) ((x) << 4)
@@ -279,13 +281,39 @@ static inline void lcd_enable_raster(void)
}
/* Disable the Raster Engine of the LCD Controller */
-static inline void lcd_disable_raster(void)
+static inline void lcd_disable_raster(bool wait_for_frame_done)
{
u32 reg;
+ u32 loop_cnt = 0;
+ u32 stat;
+ u32 i = 0;
+
+ /* 50 milli seconds should be sufficient for a frame to complete */
+ if (wait_for_frame_done)
+ loop_cnt = 50;
reg = lcdc_read(LCD_RASTER_CTRL_REG);
if (reg & LCD_RASTER_ENABLE)
lcdc_write(reg & ~LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG);
+
+ /* Wait for the current frame to complete */
+ do {
+ if (lcd_revision = LCD_VERSION_1)
+ stat = lcdc_read(LCD_STAT_REG);
+ else
+ stat = lcdc_read(LCD_RAW_STAT_REG);
+ mdelay(1);
+ } while (!(stat & LCD_FRAME_DONE) && (i++ < loop_cnt));
+
+ if (lcd_revision = LCD_VERSION_1)
+ lcdc_write(stat, LCD_STAT_REG);
+ else
+ lcdc_write(stat, LCD_MASKED_STAT_REG);
+
+ if ((loop_cnt != 0) && (i >= loop_cnt)) {
+ pr_err("LCD Controller timed out\n");
+ return;
+ }
}
static void lcd_blit(int load_mode, struct da8xx_fb_par *par)
@@ -626,7 +654,7 @@ static int fb_setcolreg(unsigned regno, unsigned red, unsigned green,
static void lcd_reset(struct da8xx_fb_par *par)
{
/* Disable the Raster if previously Enabled */
- lcd_disable_raster();
+ lcd_disable_raster(false);
/* DMA has to be disabled */
lcdc_write(0, LCD_DMA_CTRL_REG);
@@ -724,7 +752,7 @@ static irqreturn_t lcdc_irq_handler_rev02(int irq, void *arg)
if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) {
pr_err("LCDC sync lost or underflow error occurred\n");
- lcd_disable_raster();
+ lcd_disable_raster(false);
lcdc_write(stat, LCD_MASKED_STAT_REG);
lcd_enable_raster();
} else if (stat & LCD_PL_LOAD_DONE) {
@@ -734,7 +762,7 @@ static irqreturn_t lcdc_irq_handler_rev02(int irq, void *arg)
* interrupt via the following write to the status register. If
* this is done after then one gets multiple PL done interrupts.
*/
- lcd_disable_raster();
+ lcd_disable_raster(false);
lcdc_write(stat, LCD_MASKED_STAT_REG);
@@ -780,7 +808,7 @@ static irqreturn_t lcdc_irq_handler_rev01(int irq, void *arg)
if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) {
pr_err("LCDC sync lost or underflow error occurred\n");
- lcd_disable_raster();
+ lcd_disable_raster(false);
lcdc_write(stat, LCD_STAT_REG);
lcd_enable_raster();
} else if (stat & LCD_PL_LOAD_DONE) {
@@ -790,7 +818,7 @@ static irqreturn_t lcdc_irq_handler_rev01(int irq, void *arg)
* interrupt via the following write to the status register. If
* this is done after then one gets multiple PL done interrupts.
*/
- lcd_disable_raster();
+ lcd_disable_raster(false);
lcdc_write(stat, LCD_STAT_REG);
@@ -887,7 +915,7 @@ static int lcd_da8xx_cpufreq_transition(struct notifier_block *nb,
if (val = CPUFREQ_POSTCHANGE) {
if (par->lcd_fck_rate != clk_get_rate(par->lcdc_clk)) {
par->lcd_fck_rate = clk_get_rate(par->lcdc_clk);
- lcd_disable_raster();
+ lcd_disable_raster(true);
lcd_calc_clk_divider(par);
lcd_enable_raster();
}
@@ -924,7 +952,7 @@ static int __devexit fb_remove(struct platform_device *dev)
if (par->panel_power_ctrl)
par->panel_power_ctrl(0);
- lcd_disable_raster();
+ lcd_disable_raster(true);
lcdc_write(0, LCD_RASTER_CTRL_REG);
/* disable DMA */
@@ -1037,7 +1065,7 @@ static int cfb_blank(int blank, struct fb_info *info)
if (par->panel_power_ctrl)
par->panel_power_ctrl(0);
- lcd_disable_raster();
+ lcd_disable_raster(true);
break;
default:
ret = -EINVAL;
@@ -1377,7 +1405,7 @@ static int fb_suspend(struct platform_device *dev, pm_message_t state)
par->panel_power_ctrl(0);
fb_set_suspend(info, 1);
- lcd_disable_raster();
+ lcd_disable_raster(true);
clk_disable(par->lcdc_clk);
console_unlock();
--
1.7.1
^ permalink raw reply related
* [PATCH] da8xx-fb: do not turn ON LCD backlight unless LCDC is enabled
From: Manjunathappa, Prakash @ 2012-07-24 4:27 UTC (permalink / raw)
To: linux-fbdev
LCD blink is observed during suspend/resume and blank/unblank
operations as backlight is ON during LCDC disable and enable.
So make sure to turn OFF backlight before disabling and turn
it ON after enabling.
Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
---
drivers/video/da8xx-fb.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 0fb4d7d..1a569ae 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -1056,10 +1056,10 @@ static int cfb_blank(int blank, struct fb_info *info)
par->blank = blank;
switch (blank) {
case FB_BLANK_UNBLANK:
+ lcd_enable_raster();
+
if (par->panel_power_ctrl)
par->panel_power_ctrl(1);
-
- lcd_enable_raster();
break;
case FB_BLANK_POWERDOWN:
if (par->panel_power_ctrl)
@@ -1417,11 +1417,12 @@ static int fb_resume(struct platform_device *dev)
struct da8xx_fb_par *par = info->par;
console_lock();
+ clk_enable(par->lcdc_clk);
+ lcd_enable_raster();
+
if (par->panel_power_ctrl)
par->panel_power_ctrl(1);
- clk_enable(par->lcdc_clk);
- lcd_enable_raster();
fb_set_suspend(info, 0);
console_unlock();
--
1.7.1
^ permalink raw reply related
* Re: [PATCH v2] da8xx-fb: allow frame to complete after disabling LCDC
From: Madhvapathi Sriram @ 2012-07-24 4:53 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1343102984-6056-1-git-send-email-prakash.pm@ti.com>
On Tue, Jul 24, 2012 at 9:39 AM, Manjunathappa, Prakash
<prakash.pm@ti.com> wrote:
>
> Wait for active frame transfer to complete after disabling LCDC.
> At the same this wait is not be required when there are sync and
> underflow errors.
> More information on disable and reset sequence can be found in
> section 13.4.6 of AM335x TRM @www.ti.com/am335x.
>
> Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
> ---
> Patch applies on top of below patch under review:
> http://marc.info/?l=linux-fbdev&m\x134280060828708&w=2
> "video: da8xx-fb: do clock reset of revision 2 LCDC before enabling"
> Since v1:
> Changed the commit message, also added link to hardware specification.
>
> drivers/video/da8xx-fb.c | 48
> ++++++++++++++++++++++++++++++++++++---------
> 1 files changed, 38 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
> index a908dfd..0fb4d7d 100644
> --- a/drivers/video/da8xx-fb.c
> +++ b/drivers/video/da8xx-fb.c
> @@ -31,6 +31,7 @@
> #include <linux/cpufreq.h>
> #include <linux/console.h>
> #include <linux/slab.h>
> +#include <linux/delay.h>
> #include <video/da8xx-fb.h>
> #include <asm/div64.h>
>
> @@ -45,6 +46,7 @@
> #define LCD_PL_LOAD_DONE BIT(6)
> #define LCD_FIFO_UNDERFLOW BIT(5)
> #define LCD_SYNC_LOST BIT(2)
> +#define LCD_FRAME_DONE BIT(0)
>
> /* LCD DMA Control Register */
> #define LCD_DMA_BURST_SIZE(x) ((x) << 4)
> @@ -279,13 +281,39 @@ static inline void lcd_enable_raster(void)
> }
>
> /* Disable the Raster Engine of the LCD Controller */
> -static inline void lcd_disable_raster(void)
> +static inline void lcd_disable_raster(bool wait_for_frame_done)
> {
> u32 reg;
> + u32 loop_cnt = 0;
> + u32 stat;
> + u32 i = 0;
> +
> + /* 50 milli seconds should be sufficient for a frame to complete
> */
> + if (wait_for_frame_done)
> + loop_cnt = 50;
>
> reg = lcdc_read(LCD_RASTER_CTRL_REG);
> if (reg & LCD_RASTER_ENABLE)
> lcdc_write(reg & ~LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG);
> +
> + /* Wait for the current frame to complete */
> + do {
> + if (lcd_revision = LCD_VERSION_1)
> + stat = lcdc_read(LCD_STAT_REG);
> + else
> + stat = lcdc_read(LCD_RAW_STAT_REG);
> + mdelay(1);
> + } while (!(stat & LCD_FRAME_DONE) && (i++ < loop_cnt));
Are you sure it should be do while? You call it from interrupt handler
too (sync lost handling). In that case mdelay() from interrupt
context..not a good idea I feel.
> +
> + if (lcd_revision = LCD_VERSION_1)
> + lcdc_write(stat, LCD_STAT_REG);
> + else
> + lcdc_write(stat, LCD_MASKED_STAT_REG);
> +
> + if ((loop_cnt != 0) && (i >= loop_cnt)) {
> + pr_err("LCD Controller timed out\n");
> + return;
return may not be necessary?
> + }
> }
>
> static void lcd_blit(int load_mode, struct da8xx_fb_par *par)
> @@ -626,7 +654,7 @@ static int fb_setcolreg(unsigned regno, unsigned red,
> unsigned green,
> static void lcd_reset(struct da8xx_fb_par *par)
> {
> /* Disable the Raster if previously Enabled */
> - lcd_disable_raster();
> + lcd_disable_raster(false);
>
> /* DMA has to be disabled */
> lcdc_write(0, LCD_DMA_CTRL_REG);
> @@ -724,7 +752,7 @@ static irqreturn_t lcdc_irq_handler_rev02(int irq,
> void *arg)
>
> if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) {
> pr_err("LCDC sync lost or underflow error occurred\n");
> - lcd_disable_raster();
> + lcd_disable_raster(false);
> lcdc_write(stat, LCD_MASKED_STAT_REG);
> lcd_enable_raster();
> } else if (stat & LCD_PL_LOAD_DONE) {
> @@ -734,7 +762,7 @@ static irqreturn_t lcdc_irq_handler_rev02(int irq,
> void *arg)
> * interrupt via the following write to the status
> register. If
> * this is done after then one gets multiple PL done
> interrupts.
> */
> - lcd_disable_raster();
> + lcd_disable_raster(false);
>
> lcdc_write(stat, LCD_MASKED_STAT_REG);
>
> @@ -780,7 +808,7 @@ static irqreturn_t lcdc_irq_handler_rev01(int irq,
> void *arg)
>
> if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) {
> pr_err("LCDC sync lost or underflow error occurred\n");
> - lcd_disable_raster();
> + lcd_disable_raster(false);
> lcdc_write(stat, LCD_STAT_REG);
> lcd_enable_raster();
> } else if (stat & LCD_PL_LOAD_DONE) {
> @@ -790,7 +818,7 @@ static irqreturn_t lcdc_irq_handler_rev01(int irq,
> void *arg)
> * interrupt via the following write to the status
> register. If
> * this is done after then one gets multiple PL done
> interrupts.
> */
> - lcd_disable_raster();
> + lcd_disable_raster(false);
>
> lcdc_write(stat, LCD_STAT_REG);
>
> @@ -887,7 +915,7 @@ static int lcd_da8xx_cpufreq_transition(struct
> notifier_block *nb,
> if (val = CPUFREQ_POSTCHANGE) {
> if (par->lcd_fck_rate != clk_get_rate(par->lcdc_clk)) {
> par->lcd_fck_rate = clk_get_rate(par->lcdc_clk);
> - lcd_disable_raster();
> + lcd_disable_raster(true);
> lcd_calc_clk_divider(par);
> lcd_enable_raster();
> }
> @@ -924,7 +952,7 @@ static int __devexit fb_remove(struct platform_device
> *dev)
> if (par->panel_power_ctrl)
> par->panel_power_ctrl(0);
>
> - lcd_disable_raster();
> + lcd_disable_raster(true);
> lcdc_write(0, LCD_RASTER_CTRL_REG);
>
> /* disable DMA */
> @@ -1037,7 +1065,7 @@ static int cfb_blank(int blank, struct fb_info
> *info)
> if (par->panel_power_ctrl)
> par->panel_power_ctrl(0);
>
> - lcd_disable_raster();
> + lcd_disable_raster(true);
> break;
> default:
> ret = -EINVAL;
> @@ -1377,7 +1405,7 @@ static int fb_suspend(struct platform_device *dev,
> pm_message_t state)
> par->panel_power_ctrl(0);
>
> fb_set_suspend(info, 1);
> - lcd_disable_raster();
> + lcd_disable_raster(true);
> clk_disable(par->lcdc_clk);
> console_unlock();
>
> --
> 1.7.1
>
> _______________________________________________
> Davinci-linux-open-source mailing list
> Davinci-linux-open-source@linux.davincidsp.com
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
^ permalink raw reply
* RE: [PATCH v2] da8xx-fb: allow frame to complete after disabling LCDC
From: Manjunathappa, Prakash @ 2012-07-24 7:17 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1343102984-6056-1-git-send-email-prakash.pm@ti.com>
Hi Sriram,
On Tue, Jul 24, 2012 at 10:11:55, Madhvapathi Sriram wrote:
> On Tue, Jul 24, 2012 at 9:39 AM, Manjunathappa, Prakash
> <prakash.pm@ti.com> wrote:
[...]
> > /* Disable the Raster Engine of the LCD Controller */
> > -static inline void lcd_disable_raster(void)
> > +static inline void lcd_disable_raster(bool wait_for_frame_done)
> > {
> > u32 reg;
> > + u32 loop_cnt = 0;
> > + u32 stat;
> > + u32 i = 0;
> > +
> > + /* 50 milli seconds should be sufficient for a frame to complete
> > */
> > + if (wait_for_frame_done)
> > + loop_cnt = 50;
> >
> > reg = lcdc_read(LCD_RASTER_CTRL_REG);
> > if (reg & LCD_RASTER_ENABLE)
> > lcdc_write(reg & ~LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG);
> > +
> > + /* Wait for the current frame to complete */
> > + do {
> > + if (lcd_revision = LCD_VERSION_1)
> > + stat = lcdc_read(LCD_STAT_REG);
> > + else
> > + stat = lcdc_read(LCD_RAW_STAT_REG);
> > + mdelay(1);
> > + } while (!(stat & LCD_FRAME_DONE) && (i++ < loop_cnt));
>
> Are you sure it should be do while? You call it from interrupt handler
> too (sync lost handling). In that case mdelay() from interrupt
> context..not a good idea I feel.
>
Ok. I will change it as below:
while (1) {
if (lcd_revision = LCD_VERSION_1)
stat = lcdc_read(LCD_STAT_REG);
else
stat = lcdc_read(LCD_RAW_STAT_REG);
if((stat & LCD_FRAME_DONE) || (i++ > loop_cnt))
break;
mdelay(1);
}
> > +
> > + if (lcd_revision = LCD_VERSION_1)
> > + lcdc_write(stat, LCD_STAT_REG);
> > + else
> > + lcdc_write(stat, LCD_MASKED_STAT_REG);
> > +
> > + if ((loop_cnt != 0) && (i >= loop_cnt)) {
> > + pr_err("LCD Controller timed out\n");
> > + return;
>
> return may not be necessary?
>
Agree, I will remove it.
Thanks,
Prakash
> > + }
> > }
[...]
^ permalink raw reply
* [PATCH] fbdev: Make pixel_to_pat() failure mode more friendly
From: Benjamin Herrenschmidt @ 2012-07-24 8:19 UTC (permalink / raw)
To: linux-fbdev
If we accidentally pass an incorrect bpp value to pixel_to_pat(),
it panics. This is pretty useless, as we generally have the various
console locks held at that point, so nothing will be displayed,
and there is no reason to make this a fatal event.
Let's WARN instead.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
diff --git a/drivers/video/fb_draw.h b/drivers/video/fb_draw.h
index 04c01fa..624ee11 100644
--- a/drivers/video/fb_draw.h
+++ b/drivers/video/fb_draw.h
@@ -3,6 +3,7 @@
#include <asm/types.h>
#include <linux/fb.h>
+#include <linux/bug.h>
/*
* Compose two values, using a bitmask as decision value
@@ -41,7 +42,8 @@ pixel_to_pat( u32 bpp, u32 pixel)
case 32:
return 0x0000000100000001ul*pixel;
default:
- panic("pixel_to_pat(): unsupported pixelformat\n");
+ WARN(1, "pixel_to_pat(): unsupported pixelformat %d\n", bpp);
+ return 0;
}
}
#else
@@ -66,7 +68,8 @@ pixel_to_pat( u32 bpp, u32 pixel)
case 32:
return 0x00000001ul*pixel;
default:
- panic("pixel_to_pat(): unsupported pixelformat\n");
+ WARN(1, "pixel_to_pat(): unsupported pixelformat %d\n", bpp);
+ return 0;
}
}
#endif
^ permalink raw reply related
* RE: [PATCH v2] da8xx-fb: allow frame to complete after disabling LCDC
From: Manjunathappa, Prakash @ 2012-07-24 8:26 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1343102984-6056-1-git-send-email-prakash.pm@ti.com>
On Tue, Jul 24, 2012 at 12:47:02, Manjunathappa, Prakash wrote:
> Hi Sriram,
>
> On Tue, Jul 24, 2012 at 10:11:55, Madhvapathi Sriram wrote:
> > On Tue, Jul 24, 2012 at 9:39 AM, Manjunathappa, Prakash
> > <prakash.pm@ti.com> wrote:
> [...]
> > > /* Disable the Raster Engine of the LCD Controller */
> > > -static inline void lcd_disable_raster(void)
> > > +static inline void lcd_disable_raster(bool wait_for_frame_done)
> > > {
> > > u32 reg;
> > > + u32 loop_cnt = 0;
> > > + u32 stat;
> > > + u32 i = 0;
> > > +
> > > + /* 50 milli seconds should be sufficient for a frame to complete
> > > */
> > > + if (wait_for_frame_done)
> > > + loop_cnt = 50;
> > >
> > > reg = lcdc_read(LCD_RASTER_CTRL_REG);
> > > if (reg & LCD_RASTER_ENABLE)
> > > lcdc_write(reg & ~LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG);
> > > +
> > > + /* Wait for the current frame to complete */
> > > + do {
> > > + if (lcd_revision = LCD_VERSION_1)
> > > + stat = lcdc_read(LCD_STAT_REG);
> > > + else
> > > + stat = lcdc_read(LCD_RAW_STAT_REG);
> > > + mdelay(1);
> > > + } while (!(stat & LCD_FRAME_DONE) && (i++ < loop_cnt));
> >
> > Are you sure it should be do while? You call it from interrupt handler
> > too (sync lost handling). In that case mdelay() from interrupt
> > context..not a good idea I feel.
> >
>
> Ok. I will change it as below:
>
> while (1) {
> if (lcd_revision = LCD_VERSION_1)
> stat = lcdc_read(LCD_STAT_REG);
> else
> stat = lcdc_read(LCD_RAW_STAT_REG);
> if((stat & LCD_FRAME_DONE) || (i++ > loop_cnt))
s/i++/++i
Thanks,
Prakash
> break;
> mdelay(1);
> }
>
> > > +
> > > + if (lcd_revision = LCD_VERSION_1)
> > > + lcdc_write(stat, LCD_STAT_REG);
> > > + else
> > > + lcdc_write(stat, LCD_MASKED_STAT_REG);
> > > +
> > > + if ((loop_cnt != 0) && (i >= loop_cnt)) {
> > > + pr_err("LCD Controller timed out\n");
> > > + return;
> >
> > return may not be necessary?
> >
>
> Agree, I will remove it.
>
> Thanks,
> Prakash
>
> > > + }
> > > }
>
> [...]
>
>
^ permalink raw reply
* Re: [PATCH v2] da8xx-fb: allow frame to complete after disabling LCDC
From: Madhvapathi Sriram @ 2012-07-24 8:50 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1343102984-6056-1-git-send-email-prakash.pm@ti.com>
On Tue, Jul 24, 2012 at 12:47 PM, Manjunathappa, Prakash
<prakash.pm@ti.com> wrote:
> Hi Sriram,
>
> On Tue, Jul 24, 2012 at 10:11:55, Madhvapathi Sriram wrote:
>> On Tue, Jul 24, 2012 at 9:39 AM, Manjunathappa, Prakash
>> <prakash.pm@ti.com> wrote:
> [...]
>> > /* Disable the Raster Engine of the LCD Controller */
>> > -static inline void lcd_disable_raster(void)
>> > +static inline void lcd_disable_raster(bool wait_for_frame_done)
>> > {
>> > u32 reg;
>> > + u32 loop_cnt = 0;
>> > + u32 stat;
>> > + u32 i = 0;
>> > +
>> > + /* 50 milli seconds should be sufficient for a frame to complete
>> > */
>> > + if (wait_for_frame_done)
>> > + loop_cnt = 50;
>> >
>> > reg = lcdc_read(LCD_RASTER_CTRL_REG);
>> > if (reg & LCD_RASTER_ENABLE)
>> > lcdc_write(reg & ~LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG);
>> > +
>> > + /* Wait for the current frame to complete */
>> > + do {
>> > + if (lcd_revision = LCD_VERSION_1)
>> > + stat = lcdc_read(LCD_STAT_REG);
>> > + else
>> > + stat = lcdc_read(LCD_RAW_STAT_REG);
>> > + mdelay(1);
>> > + } while (!(stat & LCD_FRAME_DONE) && (i++ < loop_cnt));
>>
>> Are you sure it should be do while? You call it from interrupt handler
>> too (sync lost handling). In that case mdelay() from interrupt
>> context..not a good idea I feel.
>>
>
> Ok. I will change it as below:
>
> while (1) {
> if (lcd_revision = LCD_VERSION_1)
> stat = lcdc_read(LCD_STAT_REG);
> else
> stat = lcdc_read(LCD_RAW_STAT_REG);
> if((stat & LCD_FRAME_DONE) || (i++ > loop_cnt))
> break;
> mdelay(1);
> }
>
Hmm.. while(1) could be avoided though. Club all frame-done-wait
related at one place. I leave it open for your choice.
Some where in the beginning of fxn....
u32 stat_reg = LCD_STAT_REG;
Avoids conditions in loop....
if (lcd_revision = LCD_VERSION_2)
stat_reg = LCD_RAW_STAT_REG;
if (wait_for_frame_done) {
u32 loop_count = 50;
while (!(lcdc_read(stat_reg) & LCD_FRAME_DONE)) {
/* Handle timeout */
if(unlikely(0 = --loop_count)) {
pr_err("LCD Controller timed out\n");
break;
}
mdelay(1);
}
}
>> > +
>> > + if (lcd_revision = LCD_VERSION_1)
>> > + lcdc_write(stat, LCD_STAT_REG);
>> > + else
>> > + lcdc_write(stat, LCD_MASKED_STAT_REG);
>> > +
>> > + if ((loop_cnt != 0) && (i >= loop_cnt)) {
>> > + pr_err("LCD Controller timed out\n");
>> > + return;
>>
>> return may not be necessary?
>>
>
> Agree, I will remove it.
>
> Thanks,
> Prakash
>
>> > + }
>> > }
>
> [...]
>
^ permalink raw reply
* [GIT PULL] SH Mobile LCDC and MERAM patches
From: Laurent Pinchart @ 2012-07-24 9:16 UTC (permalink / raw)
To: linux-fbdev
Hi Florian,
The following changes since commit 6fcdbc0c3a683003a00f383fceac80da1b7852ff:
s3fb: Add Virge/MX (86C260) (2012-07-08 14:03:50 +0000)
are available in the git repository at:
git://linuxtv.org/pinchartl/fbdev.git for-next
Laurent Pinchart (9):
sh_mobile_meram: Rename operations to cache_[alloc|free|update]
sh_mobile_meram: Use direct function calls for the public API
sh_mobile_meram: Add direct MERAM allocation API
fbdev: sh_mobile_lcdc: Destroy mutex at remove time
fbdev: sh_mobile_lcdc: Fix line pitch computation
fbdev: sh_mobile_lcdc: Use channel configuration to initialize fb device
fbdev: sh_mobile_lcdc: Support horizontal panning
fbdev: sh_mobile_lcdc: Fix overlay registers update during pan operation
fbdev: sh_mobile_lcdc: Fix pan offset computation in YUV mode
drivers/video/sh_mobile_lcdcfb.c | 209 +++++++++++++++++----------------
drivers/video/sh_mobile_lcdcfb.h | 5 +-
drivers/video/sh_mobile_meram.c | 235 ++++++++++++++++++++-----------------
include/video/sh_mobile_meram.h | 71 ++++++++----
4 files changed, 293 insertions(+), 227 deletions(-)
--
Regards,
Laurent Pinchart
^ permalink raw reply
* RE: [PATCH v2] da8xx-fb: allow frame to complete after disabling LCDC
From: Manjunathappa, Prakash @ 2012-07-24 9:34 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1343102984-6056-1-git-send-email-prakash.pm@ti.com>
On Tue, Jul 24, 2012 at 14:08:05, Madhvapathi Sriram wrote:
> On Tue, Jul 24, 2012 at 12:47 PM, Manjunathappa, Prakash
> <prakash.pm@ti.com> wrote:
> > Hi Sriram,
> >
> > On Tue, Jul 24, 2012 at 10:11:55, Madhvapathi Sriram wrote:
> >> On Tue, Jul 24, 2012 at 9:39 AM, Manjunathappa, Prakash
> >> <prakash.pm@ti.com> wrote:
> > [...]
> >> > /* Disable the Raster Engine of the LCD Controller */
> >> > -static inline void lcd_disable_raster(void)
> >> > +static inline void lcd_disable_raster(bool wait_for_frame_done)
> >> > {
> >> > u32 reg;
> >> > + u32 loop_cnt = 0;
> >> > + u32 stat;
> >> > + u32 i = 0;
> >> > +
> >> > + /* 50 milli seconds should be sufficient for a frame to complete
> >> > */
> >> > + if (wait_for_frame_done)
> >> > + loop_cnt = 50;
> >> >
> >> > reg = lcdc_read(LCD_RASTER_CTRL_REG);
> >> > if (reg & LCD_RASTER_ENABLE)
> >> > lcdc_write(reg & ~LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG);
> >> > +
> >> > + /* Wait for the current frame to complete */
> >> > + do {
> >> > + if (lcd_revision = LCD_VERSION_1)
> >> > + stat = lcdc_read(LCD_STAT_REG);
> >> > + else
> >> > + stat = lcdc_read(LCD_RAW_STAT_REG);
> >> > + mdelay(1);
> >> > + } while (!(stat & LCD_FRAME_DONE) && (i++ < loop_cnt));
> >>
> >> Are you sure it should be do while? You call it from interrupt handler
> >> too (sync lost handling). In that case mdelay() from interrupt
> >> context..not a good idea I feel.
> >>
> >
> > Ok. I will change it as below:
> >
> > while (1) {
> > if (lcd_revision = LCD_VERSION_1)
> > stat = lcdc_read(LCD_STAT_REG);
> > else
> > stat = lcdc_read(LCD_RAW_STAT_REG);
> > if((stat & LCD_FRAME_DONE) || (i++ > loop_cnt))
> > break;
> > mdelay(1);
> > }
> >
> Hmm.. while(1) could be avoided though. Club all frame-done-wait
> related at one place. I leave it open for your choice.
>
> Some where in the beginning of fxn....
> u32 stat_reg = LCD_STAT_REG;
>
> Avoids conditions in loop....
> if (lcd_revision = LCD_VERSION_2)
> stat_reg = LCD_RAW_STAT_REG;
>
> if (wait_for_frame_done) {
> u32 loop_count = 50;
>
> while (!(lcdc_read(stat_reg) & LCD_FRAME_DONE)) {
> /* Handle timeout */
> if(unlikely(0 = --loop_count)) {
> pr_err("LCD Controller timed out\n");
> break;
> }
> mdelay(1);
> }
> }
>
>
Thanks Sriram, I will consider this.
> >> > +
> >> > + if (lcd_revision = LCD_VERSION_1)
> >> > + lcdc_write(stat, LCD_STAT_REG);
> >> > + else
> >> > + lcdc_write(stat, LCD_MASKED_STAT_REG);
> >> > +
> >> > + if ((loop_cnt != 0) && (i >= loop_cnt)) {
> >> > + pr_err("LCD Controller timed out\n");
> >> > + return;
> >>
> >> return may not be necessary?
> >>
> >
> > Agree, I will remove it.
> >
> > Thanks,
> > Prakash
> >
> >> > + }
> >> > }
> >
> > [...]
> >
>
^ permalink raw reply
* Re: [PATCH v2] da8xx-fb: enable sync lost interrupt
From: Sergei Shtylyov @ 2012-07-24 11:21 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1343101413-1820-1-git-send-email-prakash.pm@ti.com>
Hello.
On 24-07-2012 7:43, Manjunathappa, Prakash wrote:
> Patch enables sync lost interrupt and interrupt handler already
> takes care to handle it.
> Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
> ---
> Since v1:
> Minor nit, replaced spaces with tabs.
> drivers/video/da8xx-fb.c | 7 +++++--
> 1 files changed, 5 insertions(+), 2 deletions(-)
> diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
> index 47118c7..8163832 100644
> --- a/drivers/video/da8xx-fb.c
> +++ b/drivers/video/da8xx-fb.c
[...]
> @@ -718,6 +719,7 @@ static irqreturn_t lcdc_irq_handler_rev02(int irq, void *arg)
> u32 reg_int;
>
> if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) {
> + pr_err("LCDC sync lost or underflow error occurred\n");
You write "or" here. Perhaps it should be || instead of && above?
> lcd_disable_raster();
> lcdc_write(stat, LCD_MASKED_STAT_REG);
> lcd_enable_raster();
> @@ -773,6 +775,7 @@ static irqreturn_t lcdc_irq_handler_rev01(int irq, void *arg)
> u32 reg_ras;
>
> if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) {
> + pr_err("LCDC sync lost or underflow error occurred\n");
Same comment.
WBR, Sergei
^ permalink raw reply
* (no subject)
From: roboth roli company @ 2012-07-24 11:46 UTC (permalink / raw)
To: linux-fbdev
i am robothroli, Purchase manager from roli Merchant Ltd. We are
Import/export Company based in taiwan. We are interested in purchasing
your product and I would like to make an inquiry. Please inform me on:
Sample availability and price
Minimum order quantity
FOB Prices
Sincerely
Purchase Manager
robothroli
^ permalink raw reply
* [PATCH] OMAPDSS: DISPC: Use msleep instead of blocking mdelay
From: Jassi Brar @ 2012-07-24 14:15 UTC (permalink / raw)
To: tomi.valkeinen, a0393947; +Cc: linux-omap, linux-fbdev, Jassi Brar
We have no reason to block in the error handler workqueue, so use msleep.
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
---
drivers/video/omap2/dss/dispc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index c56a51a..0e3ad44 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3492,7 +3492,7 @@ static void dispc_error_worker(struct work_struct *work)
ovl->name);
dispc_ovl_enable(ovl->id, false);
dispc_mgr_go(ovl->manager->id);
- mdelay(50);
+ msleep(50);
}
}
@@ -3524,7 +3524,7 @@ static void dispc_error_worker(struct work_struct *work)
}
dispc_mgr_go(mgr->id);
- mdelay(50);
+ msleep(50);
if (enable)
dssdev->driver->enable(dssdev);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 0/3] Use dma_mmap_coherent to support IOMMU mapper
From: Hideki EIRAKU @ 2012-07-25 6:29 UTC (permalink / raw)
To: linux-arm-kernel
There is a dma_mmap_coherent() API in some architectures. This API
provides a mmap function for memory allocated by dma_alloc_coherent().
Some drivers mmap a dma_addr_t returned by dma_alloc_coherent() as a
physical address. But such drivers do not work correctly when IOMMU
mapper is used.
Hideki EIRAKU (3):
ARM: dma-mapping: define ARCH_HAS_DMA_MMAP_COHERENT
media: videobuf2-dma-contig: use dma_mmap_coherent if available
fbdev: sh_mobile_lcdc: use dma_mmap_coherent if available
arch/arm/include/asm/dma-mapping.h | 1 +
drivers/media/video/videobuf2-dma-contig.c | 18 ++++++++++++++++++
drivers/video/sh_mobile_lcdcfb.c | 14 ++++++++++++++
3 files changed, 33 insertions(+), 0 deletions(-)
^ permalink raw reply
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