Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 344572
b: refs/heads/master
c: 33366d0
h: refs/heads/master
v: v3
  • Loading branch information
Tomi Valkeinen committed Oct 17, 2012
1 parent 2d6289c commit ace998d
Show file tree
Hide file tree
Showing 14 changed files with 342 additions and 183 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: da6c56873927418aba585038e5c4d3d72a4d9b6c
refs/heads/master: 33366d0e8be06b980784c732ebace26de08e6679
38 changes: 38 additions & 0 deletions trunk/arch/arm/mach-omap2/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,54 @@ static struct platform_device *create_simple_dss_pdev(const char *pdev_name,
return ERR_PTR(r);
}

static enum omapdss_version __init omap_display_get_version(void)
{
if (cpu_is_omap24xx())
return OMAPDSS_VER_OMAP24xx;
else if (cpu_is_omap3630())
return OMAPDSS_VER_OMAP3630;
else if (cpu_is_omap34xx()) {
if (soc_is_am35xx()) {
return OMAPDSS_VER_AM35xx;
} else {
if (omap_rev() < OMAP3430_REV_ES3_0)
return OMAPDSS_VER_OMAP34xx_ES1;
else
return OMAPDSS_VER_OMAP34xx_ES3;
}
} else if (omap_rev() == OMAP4430_REV_ES1_0)
return OMAPDSS_VER_OMAP4430_ES1;
else if (omap_rev() == OMAP4430_REV_ES2_0 ||
omap_rev() == OMAP4430_REV_ES2_1 ||
omap_rev() == OMAP4430_REV_ES2_2)
return OMAPDSS_VER_OMAP4430_ES2;
else if (cpu_is_omap44xx())
return OMAPDSS_VER_OMAP4;
else if (soc_is_omap54xx())
return OMAPDSS_VER_OMAP5;
else
return OMAPDSS_VER_UNKNOWN;
}

int __init omap_display_init(struct omap_dss_board_info *board_data)
{
int r = 0;
struct platform_device *pdev;
int i, oh_count;
const struct omap_dss_hwmod_data *curr_dss_hwmod;
struct platform_device *dss_pdev;
enum omapdss_version ver;

/* create omapdss device */

ver = omap_display_get_version();

if (ver == OMAPDSS_VER_UNKNOWN) {
pr_err("DSS not supported on this SoC\n");
return -ENODEV;
}

board_data->version = ver;
board_data->dsi_enable_pads = omap_dsi_enable_pads;
board_data->dsi_disable_pads = omap_dsi_disable_pads;
board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count;
Expand Down
22 changes: 6 additions & 16 deletions trunk/drivers/video/omap2/dss/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,16 @@ config OMAP2_VRAM_SIZE
You can also set this with "vram=<bytes>" kernel argument, or
in the board file.

config OMAP2_DSS_DEBUG
bool "Debug support"
default n
help
This enables printing of debug messages. Alternatively, debug messages
can also be enabled by setting CONFIG_DYNAMIC_DEBUG and then setting
appropriate flags in <debugfs>/dynamic_debug/control.

config OMAP2_DSS_DEBUGFS
bool "Debugfs filesystem support"
depends on DEBUG_FS
default n
config OMAP2_DSS_DEBUG_SUPPORT
bool "Debug support"
default y
help
This enables debugfs for OMAPDSS at <debugfs>/omapdss. This enables
querying about clock configuration and register configuration of dss,
dispc, dsi, hdmi and rfbi.
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_DEBUGFS
depends on OMAP2_DSS_DEBUG_SUPPORT
default n
help
Collect DSS IRQ statistics, printable via debugfs.
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/video/omap2/dss/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o
omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o
omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi.o \
hdmi_panel.o ti_hdmi_4xxx_ip.o
ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG
8 changes: 4 additions & 4 deletions trunk/drivers/video/omap2/dss/apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ static void dss_ovl_write_regs(struct omap_overlay *ovl)
struct mgr_priv_data *mp;
int r;

DSSDBG("writing ovl %d regs", ovl->id);
DSSDBGF("%d", ovl->id);

if (!op->enabled || !op->info_dirty)
return;
Expand Down Expand Up @@ -608,7 +608,7 @@ static void dss_ovl_write_regs_extra(struct omap_overlay *ovl)
struct ovl_priv_data *op = get_ovl_priv(ovl);
struct mgr_priv_data *mp;

DSSDBG("writing ovl %d regs extra", ovl->id);
DSSDBGF("%d", ovl->id);

if (!op->extra_info_dirty)
return;
Expand All @@ -632,7 +632,7 @@ static void dss_mgr_write_regs(struct omap_overlay_manager *mgr)
struct mgr_priv_data *mp = get_mgr_priv(mgr);
struct omap_overlay *ovl;

DSSDBG("writing mgr %d regs", mgr->id);
DSSDBGF("%d", mgr->id);

if (!mp->enabled)
return;
Expand All @@ -658,7 +658,7 @@ static void dss_mgr_write_regs_extra(struct omap_overlay_manager *mgr)
{
struct mgr_priv_data *mp = get_mgr_priv(mgr);

DSSDBG("writing mgr %d regs extra", mgr->id);
DSSDBGF("%d", mgr->id);

if (!mp->extra_info_dirty)
return;
Expand Down
15 changes: 10 additions & 5 deletions trunk/drivers/video/omap2/dss/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ static char *def_disp_name;
module_param_named(def_disp, def_disp_name, charp, 0);
MODULE_PARM_DESC(def_disp, "default display name");

#ifdef DEBUG
bool dss_debug;
module_param_named(debug, dss_debug, bool, 0644);
#endif

const char *dss_get_default_display_name(void)
{
return core.default_display_name;
Expand Down Expand Up @@ -117,7 +122,7 @@ void dss_dsi_disable_pads(int dsi_id, unsigned lane_mask)
{
struct omap_dss_board_info *board_data = core.pdev->dev.platform_data;

if (!board_data->dsi_disable_pads)
if (!board_data->dsi_enable_pads)
return;

return board_data->dsi_disable_pads(dsi_id, lane_mask);
Expand All @@ -133,7 +138,7 @@ int dss_set_min_bus_tput(struct device *dev, unsigned long tput)
return 0;
}

#if defined(CONFIG_OMAP2_DSS_DEBUGFS)
#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
static int dss_debug_show(struct seq_file *s, void *unused)
{
void (*func)(struct seq_file *) = s->private;
Expand Down Expand Up @@ -188,7 +193,7 @@ int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *))

return 0;
}
#else /* CONFIG_OMAP2_DSS_DEBUGFS */
#else /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */
static inline int dss_initialize_debugfs(void)
{
return 0;
Expand All @@ -200,7 +205,7 @@ int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *))
{
return 0;
}
#endif /* CONFIG_OMAP2_DSS_DEBUGFS */
#endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */

/* PLATFORM DEVICE */
static int omap_dss_pm_notif(struct notifier_block *b, unsigned long v, void *d)
Expand Down Expand Up @@ -232,7 +237,7 @@ static int __init omap_dss_probe(struct platform_device *pdev)

core.pdev = pdev;

dss_features_init();
dss_features_init(pdata->version);

dss_apply_init();

Expand Down
84 changes: 54 additions & 30 deletions trunk/drivers/video/omap2/dss/dispc.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>

#include <plat/cpu.h>
#include <linux/sizes.h>

#include <video/omapdss.h>

Expand Down Expand Up @@ -3671,26 +3670,34 @@ int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask)
}
EXPORT_SYMBOL(omap_dispc_unregister_isr);

#ifdef DEBUG
static void print_irq_status(u32 status)
{
if ((status & dispc.irq_error_mask) == 0)
return;

#define PIS(x) (status & DISPC_IRQ_##x) ? (#x " ") : ""

pr_debug("DISPC IRQ: 0x%x: %s%s%s%s%s%s%s%s%s\n",
status,
PIS(OCP_ERR),
PIS(GFX_FIFO_UNDERFLOW),
PIS(VID1_FIFO_UNDERFLOW),
PIS(VID2_FIFO_UNDERFLOW),
dss_feat_get_num_ovls() > 3 ? PIS(VID3_FIFO_UNDERFLOW) : "",
PIS(SYNC_LOST),
PIS(SYNC_LOST_DIGIT),
dss_has_feature(FEAT_MGR_LCD2) ? PIS(SYNC_LOST2) : "",
dss_has_feature(FEAT_MGR_LCD3) ? PIS(SYNC_LOST3) : "");
printk(KERN_DEBUG "DISPC IRQ: 0x%x: ", status);

#define PIS(x) \
if (status & DISPC_IRQ_##x) \
printk(#x " ");
PIS(GFX_FIFO_UNDERFLOW);
PIS(OCP_ERR);
PIS(VID1_FIFO_UNDERFLOW);
PIS(VID2_FIFO_UNDERFLOW);
if (dss_feat_get_num_ovls() > 3)
PIS(VID3_FIFO_UNDERFLOW);
PIS(SYNC_LOST);
PIS(SYNC_LOST_DIGIT);
if (dss_has_feature(FEAT_MGR_LCD2))
PIS(SYNC_LOST2);
if (dss_has_feature(FEAT_MGR_LCD3))
PIS(SYNC_LOST3);
#undef PIS

printk("\n");
}
#endif

/* Called from dss.c. Note that we don't touch clocks here,
* but we presume they are on because we got an IRQ. However,
Expand Down Expand Up @@ -3723,8 +3730,10 @@ static irqreturn_t omap_dispc_irq_handler(int irq, void *arg)
spin_unlock(&dispc.irq_stats_lock);
#endif

print_irq_status(irqstatus);

#ifdef DEBUG
if (dss_debug)
print_irq_status(irqstatus);
#endif
/* Ack the interrupt. Do it here before clocks are possibly turned
* off */
dispc_write_reg(DISPC_IRQSTATUS, irqstatus);
Expand Down Expand Up @@ -4032,29 +4041,44 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
.gfx_fifo_workaround = true,
};

static int __init dispc_init_features(struct device *dev)
static int __init dispc_init_features(struct platform_device *pdev)
{
struct omap_dss_board_info *pdata = pdev->dev.platform_data;
const struct dispc_features *src;
struct dispc_features *dst;

dst = devm_kzalloc(dev, sizeof(*dst), GFP_KERNEL);
dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL);
if (!dst) {
dev_err(dev, "Failed to allocate DISPC Features\n");
dev_err(&pdev->dev, "Failed to allocate DISPC Features\n");
return -ENOMEM;
}

if (cpu_is_omap24xx()) {
switch (pdata->version) {
case OMAPDSS_VER_OMAP24xx:
src = &omap24xx_dispc_feats;
} else if (cpu_is_omap34xx()) {
if (omap_rev() < OMAP3430_REV_ES3_0)
src = &omap34xx_rev1_0_dispc_feats;
else
src = &omap34xx_rev3_0_dispc_feats;
} else if (cpu_is_omap44xx()) {
break;

case OMAPDSS_VER_OMAP34xx_ES1:
src = &omap34xx_rev1_0_dispc_feats;
break;

case OMAPDSS_VER_OMAP34xx_ES3:
case OMAPDSS_VER_OMAP3630:
case OMAPDSS_VER_AM35xx:
src = &omap34xx_rev3_0_dispc_feats;
break;

case OMAPDSS_VER_OMAP4430_ES1:
case OMAPDSS_VER_OMAP4430_ES2:
case OMAPDSS_VER_OMAP4:
src = &omap44xx_dispc_feats;
} else if (soc_is_omap54xx()) {
break;

case OMAPDSS_VER_OMAP5:
src = &omap44xx_dispc_feats;
} else {
break;

default:
return -ENODEV;
}

Expand All @@ -4074,7 +4098,7 @@ static int __init omap_dispchw_probe(struct platform_device *pdev)

dispc.pdev = pdev;

r = dispc_init_features(&dispc.pdev->dev);
r = dispc_init_features(dispc.pdev);
if (r)
return r;

Expand Down
Loading

0 comments on commit ace998d

Please sign in to comment.