Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://gitorious.org/linux-omap-dss2/linux
Browse files Browse the repository at this point in the history
* 'for-linus' of git://gitorious.org/linux-omap-dss2/linux:
  OMAP: DSS2: OMAPFB: fix crash when panel driver was not loaded
  OMAP: DSS2: Reject scaling settings when they cannot be supported
  OMAP: DSS2: Make check-delay-loops consistent
  OMAP: DSS2: OMAPFB: fix omapfb_free_fbmem()
  video/omap: add __init/__exit macros to drivers/video/omap/lcd_htcherald.c
  OMAP: DSS2: Fix compile warning
  MAINTAINERS: Combine DSS2 and OMAPFB2 into one entry
  MAINTAINERS: change omapfb maintainer
  OMAP: OMAPFB: add dummy release function for omapdss
  OMAP: OMAPFB: fix clk_get for RFBI
  OMAP: DSS2: RFBI: convert to new kfifo API
  OMAP: DSS2: Fix crash when panel doesn't define enable_te()
  OMAP: DSS2: Collect interrupt statistics
  OMAP: DSS2: DSI: print debug DCS cmd in hex
  OMAP: DSS2: DSI: fix VC channels in send_short and send_null
  • Loading branch information
torvalds committed Jan 13, 2010
2 parents 2c76127 + 807a751 commit 90aeb7c
Show file tree
Hide file tree
Showing 14 changed files with 309 additions and 67 deletions.
17 changes: 4 additions & 13 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3940,29 +3940,20 @@ S: Maintained
F: sound/soc/omap/

OMAP FRAMEBUFFER SUPPORT
M: Imre Deak <imre.deak@nokia.com>
M: Tomi Valkeinen <tomi.valkeinen@nokia.com>
L: [email protected]
L: [email protected]
S: Maintained
F: drivers/video/omap/

OMAP DISPLAY SUBSYSTEM SUPPORT (DSS2)
OMAP DISPLAY SUBSYSTEM and FRAMEBUFFER SUPPORT (DSS2)
M: Tomi Valkeinen <[email protected]>
L: [email protected]
L: [email protected] (moderated for non-subscribers)
L: [email protected]
S: Maintained
F: drivers/video/omap2/dss/
F: drivers/video/omap2/vrfb.c
F: drivers/video/omap2/vram.c
F: drivers/video/omap2/
F: Documentation/arm/OMAP/DSS

OMAP FRAMEBUFFER SUPPORT (FOR DSS2)
M: Tomi Valkeinen <[email protected]>
L: [email protected]
L: [email protected] (moderated for non-subscribers)
S: Maintained
F: drivers/video/omap2/omapfb/

OMAP MMC SUPPORT
M: Jarkko Lavinen <[email protected]>
L: [email protected]
Expand Down
18 changes: 3 additions & 15 deletions drivers/video/omap/dispc.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,6 @@ static struct {
struct omapfb_color_key color_key;
} dispc;

static struct platform_device omapdss_device = {
.name = "omapdss",
.id = -1,
};

static void enable_lcd_clocks(int enable);

static void inline dispc_write_reg(int idx, u32 val)
Expand Down Expand Up @@ -920,20 +915,20 @@ static irqreturn_t omap_dispc_irq_handler(int irq, void *dev)

static int get_dss_clocks(void)
{
dispc.dss_ick = clk_get(&omapdss_device.dev, "ick");
dispc.dss_ick = clk_get(&dispc.fbdev->dssdev->dev, "ick");
if (IS_ERR(dispc.dss_ick)) {
dev_err(dispc.fbdev->dev, "can't get ick\n");
return PTR_ERR(dispc.dss_ick);
}

dispc.dss1_fck = clk_get(&omapdss_device.dev, "dss1_fck");
dispc.dss1_fck = clk_get(&dispc.fbdev->dssdev->dev, "dss1_fck");
if (IS_ERR(dispc.dss1_fck)) {
dev_err(dispc.fbdev->dev, "can't get dss1_fck\n");
clk_put(dispc.dss_ick);
return PTR_ERR(dispc.dss1_fck);
}

dispc.dss_54m_fck = clk_get(&omapdss_device.dev, "tv_fck");
dispc.dss_54m_fck = clk_get(&dispc.fbdev->dssdev->dev, "tv_fck");
if (IS_ERR(dispc.dss_54m_fck)) {
dev_err(dispc.fbdev->dev, "can't get tv_fck\n");
clk_put(dispc.dss_ick);
Expand Down Expand Up @@ -1385,12 +1380,6 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
int skip_init = 0;
int i;

r = platform_device_register(&omapdss_device);
if (r) {
dev_err(fbdev->dev, "can't register omapdss device\n");
return r;
}

memset(&dispc, 0, sizeof(dispc));

dispc.base = ioremap(DISPC_BASE, SZ_1K);
Expand Down Expand Up @@ -1534,7 +1523,6 @@ static void omap_dispc_cleanup(void)
free_irq(INT_24XX_DSS_IRQ, dispc.fbdev);
put_dss_clocks();
iounmap(dispc.base);
platform_device_unregister(&omapdss_device);
}

const struct lcd_ctrl omap2_int_ctrl = {
Expand Down
4 changes: 2 additions & 2 deletions drivers/video/omap/lcd_htcherald.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ struct platform_driver htcherald_panel_driver = {
},
};

static int htcherald_panel_drv_init(void)
static int __init htcherald_panel_drv_init(void)
{
return platform_driver_register(&htcherald_panel_driver);
}

static void htcherald_panel_drv_cleanup(void)
static void __exit htcherald_panel_drv_cleanup(void)
{
platform_driver_unregister(&htcherald_panel_driver);
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/video/omap/omapfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ struct omapfb_device {

struct omapfb_mem_desc mem_desc;
struct fb_info *fb_info[OMAPFB_PLANE_NUM];

struct platform_device *dssdev; /* dummy dev for clocks */
};

#ifdef CONFIG_ARCH_OMAP1
Expand Down
25 changes: 25 additions & 0 deletions drivers/video/omap/omapfb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,19 @@ static struct caps_table_struct color_caps[] = {
{ 1 << OMAPFB_COLOR_YUY422, "YUY422", },
};

static void omapdss_release(struct device *dev)
{
}

/* dummy device for clocks */
static struct platform_device omapdss_device = {
.name = "omapdss",
.id = -1,
.dev = {
.release = omapdss_release,
},
};

/*
* ---------------------------------------------------------------------------
* LCD panel
Expand Down Expand Up @@ -1700,6 +1713,7 @@ static int omapfb_do_probe(struct platform_device *pdev,

fbdev->dev = &pdev->dev;
fbdev->panel = panel;
fbdev->dssdev = &omapdss_device;
platform_set_drvdata(pdev, fbdev);

mutex_init(&fbdev->rqueue_mutex);
Expand Down Expand Up @@ -1814,8 +1828,16 @@ static int omapfb_do_probe(struct platform_device *pdev,

static int omapfb_probe(struct platform_device *pdev)
{
int r;

BUG_ON(fbdev_pdev != NULL);

r = platform_device_register(&omapdss_device);
if (r) {
dev_err(&pdev->dev, "can't register omapdss device\n");
return r;
}

/* Delay actual initialization until the LCD is registered */
fbdev_pdev = pdev;
if (fbdev_panel != NULL)
Expand Down Expand Up @@ -1843,6 +1865,9 @@ static int omapfb_remove(struct platform_device *pdev)
fbdev->state = OMAPFB_DISABLED;
omapfb_free_resources(fbdev, saved_state);

platform_device_unregister(&omapdss_device);
fbdev->dssdev = NULL;

return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/video/omap/rfbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ static inline u32 rfbi_read_reg(int idx)

static int rfbi_get_clocks(void)
{
rfbi.dss_ick = clk_get(rfbi.fbdev->dev, "ick");
rfbi.dss_ick = clk_get(&dispc.fbdev->dssdev->dev, "ick");
if (IS_ERR(rfbi.dss_ick)) {
dev_err(rfbi.fbdev->dev, "can't get ick\n");
return PTR_ERR(rfbi.dss_ick);
}

rfbi.dss1_fck = clk_get(rfbi.fbdev->dev, "dss1_fck");
rfbi.dss1_fck = clk_get(&dispc.fbdev->dssdev->dev, "dss1_fck");
if (IS_ERR(rfbi.dss1_fck)) {
dev_err(rfbi.fbdev->dev, "can't get dss1_fck\n");
clk_put(rfbi.dss_ick);
Expand Down
7 changes: 7 additions & 0 deletions drivers/video/omap2/dss/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ config OMAP2_DSS_DEBUG_SUPPORT
This enables debug messages. You need to enable printing
with 'debug' module parameter.

config OMAP2_DSS_COLLECT_IRQ_STATS
bool "Collect DSS IRQ statistics"
depends on OMAP2_DSS_DEBUG_SUPPORT
default n
help
Collect DSS IRQ statistics, printable via debugfs

config OMAP2_DSS_RFBI
bool "RFBI support"
default n
Expand Down
10 changes: 10 additions & 0 deletions drivers/video/omap2/dss/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ static void restore_all_ctx(void)
dss_clk_disable_all_no_ctx();
}

#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
/* CLOCKS */
static void core_dump_clocks(struct seq_file *s)
{
Expand All @@ -149,6 +150,7 @@ static void core_dump_clocks(struct seq_file *s)
clocks[i]->usecount);
}
}
#endif /* defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT) */

static int dss_get_clock(struct clk **clock, const char *clk_name)
{
Expand Down Expand Up @@ -395,6 +397,14 @@ static int dss_initialize_debugfs(void)
debugfs_create_file("clk", S_IRUGO, dss_debugfs_dir,
&dss_debug_dump_clocks, &dss_debug_fops);

debugfs_create_file("dispc_irq", S_IRUGO, dss_debugfs_dir,
&dispc_dump_irqs, &dss_debug_fops);

#ifdef CONFIG_OMAP2_DSS_DSI
debugfs_create_file("dsi_irq", S_IRUGO, dss_debugfs_dir,
&dsi_dump_irqs, &dss_debug_fops);
#endif

debugfs_create_file("dss", S_IRUGO, dss_debugfs_dir,
&dss_dump_regs, &dss_debug_fops);
debugfs_create_file("dispc", S_IRUGO, dss_debugfs_dir,
Expand Down
74 changes: 72 additions & 2 deletions drivers/video/omap2/dss/dispc.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ static const struct dispc_reg dispc_reg_att[] = { DISPC_GFX_ATTRIBUTES,
DISPC_VID_ATTRIBUTES(0),
DISPC_VID_ATTRIBUTES(1) };

struct dispc_irq_stats {
unsigned long last_reset;
unsigned irq_count;
unsigned irqs[32];
};

static struct {
void __iomem *base;

Expand All @@ -160,6 +166,11 @@ static struct {
struct work_struct error_work;

u32 ctx[DISPC_SZ_REGS / sizeof(u32)];

#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
spinlock_t irq_stats_lock;
struct dispc_irq_stats irq_stats;
#endif
} dispc;

static void _omap_dispc_set_irqs(void);
Expand Down Expand Up @@ -1443,7 +1454,10 @@ static unsigned long calc_fclk_five_taps(u16 width, u16 height,
do_div(tmp, 2 * out_height * ppl);
fclk = tmp;

if (height > 2 * out_height && ppl != out_width) {
if (height > 2 * out_height) {
if (ppl == out_width)
return 0;

tmp = pclk * (height - 2 * out_height) * out_width;
do_div(tmp, 2 * out_height * (ppl - out_width));
fclk = max(fclk, (u32) tmp);
Expand Down Expand Up @@ -1623,7 +1637,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
DSSDBG("required fclk rate = %lu Hz\n", fclk);
DSSDBG("current fclk rate = %lu Hz\n", dispc_fclk_rate());

if (fclk > dispc_fclk_rate()) {
if (!fclk || fclk > dispc_fclk_rate()) {
DSSERR("failed to set up scaling, "
"required fclk rate = %lu Hz, "
"current fclk rate = %lu Hz\n",
Expand Down Expand Up @@ -2247,6 +2261,50 @@ void dispc_dump_clocks(struct seq_file *s)
enable_clocks(0);
}

#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
void dispc_dump_irqs(struct seq_file *s)
{
unsigned long flags;
struct dispc_irq_stats stats;

spin_lock_irqsave(&dispc.irq_stats_lock, flags);

stats = dispc.irq_stats;
memset(&dispc.irq_stats, 0, sizeof(dispc.irq_stats));
dispc.irq_stats.last_reset = jiffies;

spin_unlock_irqrestore(&dispc.irq_stats_lock, flags);

seq_printf(s, "period %u ms\n",
jiffies_to_msecs(jiffies - stats.last_reset));

seq_printf(s, "irqs %d\n", stats.irq_count);
#define PIS(x) \
seq_printf(s, "%-20s %10d\n", #x, stats.irqs[ffs(DISPC_IRQ_##x)-1]);

PIS(FRAMEDONE);
PIS(VSYNC);
PIS(EVSYNC_EVEN);
PIS(EVSYNC_ODD);
PIS(ACBIAS_COUNT_STAT);
PIS(PROG_LINE_NUM);
PIS(GFX_FIFO_UNDERFLOW);
PIS(GFX_END_WIN);
PIS(PAL_GAMMA_MASK);
PIS(OCP_ERR);
PIS(VID1_FIFO_UNDERFLOW);
PIS(VID1_END_WIN);
PIS(VID2_FIFO_UNDERFLOW);
PIS(VID2_END_WIN);
PIS(SYNC_LOST);
PIS(SYNC_LOST_DIGIT);
PIS(WAKEUP);
#undef PIS
}
#else
void dispc_dump_irqs(struct seq_file *s) { }
#endif

void dispc_dump_regs(struct seq_file *s)
{
#define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, dispc_read_reg(r))
Expand Down Expand Up @@ -2665,6 +2723,13 @@ void dispc_irq_handler(void)

irqstatus = dispc_read_reg(DISPC_IRQSTATUS);

#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
spin_lock(&dispc.irq_stats_lock);
dispc.irq_stats.irq_count++;
dss_collect_irq_stats(irqstatus, dispc.irq_stats.irqs);
spin_unlock(&dispc.irq_stats_lock);
#endif

#ifdef DEBUG
if (dss_debug)
print_irq_status(irqstatus);
Expand Down Expand Up @@ -3012,6 +3077,11 @@ int dispc_init(void)

spin_lock_init(&dispc.irq_lock);

#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
spin_lock_init(&dispc.irq_stats_lock);
dispc.irq_stats.last_reset = jiffies;
#endif

INIT_WORK(&dispc.error_work, dispc_error_worker);

dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
Expand Down
Loading

0 comments on commit 90aeb7c

Please sign in to comment.